shapesecurity / shift-parser-js

ECMAScript parser that produces a Shift format AST
http://shift-ast.org/parser.html
Apache License 2.0
248 stars 28 forks source link

ParserWithLocation now also reports locations of comments #364

Closed bakkot closed 6 years ago

bakkot commented 6 years ago

As an array of [ start, end ] pairs; see readme.

Includes a version bump commit, so please rebase, not squash.

This change turned out to be a lot easier than I was expecting.

Edit to add: fixes #352 (at least, to the extent I expect it ever to be fixed).

bakkot commented 6 years ago

Changed to commentSpans. I was avoiding commentLocations because I didn't want to imply structural similarity between it and locations (which is a Map, not a list).