astnorm
astnorm copied to clipboard
AST normalization experiment
Check whether gogrep can be used as a library now for code matching purposes If yes, use it instead of doing a lot of routine comparisons manually. Otherwise, write such...
```diff - for _, _ = range expr {} + for range expr {} ```
Before: ```go if a { } else if b { } ``` After: ```go switch { case a: case b: } ```
Where possible, split single-value context assignments. ```diff - var x, y = 1, 2 + var x = 1 + var y = 2 ``` This makes handling assignments a...
For now, we're stripping comments to make things easier. If there is a need to keep comments, this issue is the right place to lead that discussion.
Single file targets are not even remotely enough. At the very least it should accept single package specifier.
The simplest way is: 1. Have a set of selected packages. Go stdlib is OK. 2. Normalize all packages from it. 3. Verify that all tests of those pacakges still...
If we map expr->expr, types info provided via `*types.Info` will not return anything for newly generated AST. Some kind of a workaround is required.