-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JSON is parsed as valid Javascript #67
Comments
Hey @Jacob-Roberts , that is correct! The lexer does not detect semantic errors (and it shouldn't!) but just makes sure that the input can be converted into valid JS tokens (such as keywords, strings, number literals, and interpunction/operators). In this case the source contains all valid tokens. If you want to find semantic errors, you should run the parser instead (
Let me know if that works for you or whether you have additional questions! ;-) |
Thank you! |
Maybe as an improvement point, you could point out in the Readme for the JS page that the parser is available. It seems from the README that the Lexer is the only option |
Good idea, I've added a short description, hopefully that covers it. |
When using this library with the following code:
and the following input
No error is detected. This returns true.
The text was updated successfully, but these errors were encountered: