reflect.js icon indicating copy to clipboard operation
reflect.js copied to clipboard

Parity with Esprima

Open zaach opened this issue 12 years ago • 4 comments

Esprima has some extra goodies on top of Mozilla's AST, such as a token list, ranges, and comments. There are also bugs with the current location information collected in reflect.js that need to be corrected.

zaach avatar Jun 03 '12 21:06 zaach

If you do this piecemeal... Comments would be my #1 vote.

ozten avatar Jun 18 '12 18:06 ozten

@ozten Comments are now supported as of 0.1.1 :)

The ast will have a comments array with the character position of the comment (as per this example).

zaach avatar Jun 18 '12 19:06 zaach

Ah, you might want to document the options argument to parse. I see now, using {comment: true} I get the comments and can use range to see if they should be before or after the element. Nice work!

ozten avatar Jun 19 '12 03:06 ozten

What would it take (downstream perhaps) to have the parser keep the comments in-place in its internal representation such that Stringify would output them right as they were?

BlackVegetable avatar Jul 10 '13 18:07 BlackVegetable