Closed nzakas closed 9 years ago
A little investigation: I tried a few other patterns that are similar:
if (foo) { /* foo */ }
export { foo /* foo */}
And the comment is not included with the }
, so definitely contained within the JSX logic. I'll take a look on Monday.
Is there a way to test token output already? I can't seem to find anything in the repo.
What do you mean by "test token output"? Like, in unit tests?
I mean, is there a way to pass a string to a function, and validate that the tokens created are as expected? test/testFail
only seem to work for ASTs. I don't see any tests that look specifically at tokens.
Sweet, should have a PR ready soon. Thanks!
Thank you!
When parsing this code:
The token for
}
appears to have an incorrect range:With a range of
[4, 28]
, callingcode.slice(token.start, token.end)
includes the comment before the}
. Is this intentional?