Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
add optional SourceLocation to Node interface #7
Quoting myself from Twitter:
I strongly feel that it is not the parser's job to determine the node to which a comment gets attached. In recent conversations with @ariya, he has agreed. Esprima bundling comment attachment, choosing an algorithm for you, was a bad idea. I believe we should leave the decision of how to handle this up to the parsers themselves, and I recommend they simply expose the insignificant syntax in a side-table (or two) along with their source offsets. Then consumers can handle the association themselves.