ng icon indicating copy to clipboard operation
ng copied to clipboard

parser: record position information on AST

Open crawshaw opened this issue 8 years ago • 0 comments

I keep meaning to put position information on the AST, and not getting to it.

My favorite Go parser right now is the new one inside cmd/compile. I think it has a pretty good model for position information:

https://go.googlesource.com/go/+/master/src/cmd/internal/src/pos.go

You can see it in use here:

https://go.googlesource.com/go/+/master/src/cmd/compile/internal/syntax/nodes.go

Every AST node should have a pos. I'm not sure if we need a method on everything for it yet, maybe.

crawshaw avatar Nov 17 '17 13:11 crawshaw