https://github.com/disruptek/dust
DUST is Unattended Syntax Truncation
https://github.com/disruptek/dust
ast bugs dust minimal nim reduce reproduce semantics syntax
Last synced: about 1 year ago
JSON representation
DUST is Unattended Syntax Truncation
- Host: GitHub
- URL: https://github.com/disruptek/dust
- Owner: disruptek
- License: mit
- Created: 2020-08-11T17:00:44.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2021-07-11T22:39:56.000Z (almost 5 years ago)
- Last Synced: 2025-04-09T16:18:20.263Z (about 1 year ago)
- Topics: ast, bugs, dust, minimal, nim, reduce, reproduce, semantics, syntax
- Language: Nim
- Homepage:
- Size: 22.5 KB
- Stars: 9
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# dust
Given a test program that produces a semantic error, mutate the AST of that
program to remove syntax that is irrelevant to the error.
## Usage
It _will_ overwrite your source file during operation.
**--define:release is _strongly recommended_.**
```
dust test.nim
```
## Example
```nim
import macros
macro foo(n: typed) =
copyNimTree(n)
# Why is this ok
foo:
var a = 3
foo:
let b = 3
# But this is not
foo:
var x = 2 + 3
if false:
x = x + 5
proc c() =
echo x
discard
```
...turns into...
```nim
import
macros
macro foo(n: typed) =
copyNimTree(n)
foo:
proc c() =
discard
```
## License
MIT