Keywords trip up the parser in unexpected ways
See original GitHub issueThere are many cases where keywords cause the parsing to fail:
S.obj nullable: false
fails to parse because “able” is unexpected after null
Also tangentially, quoting nullable
doesn’t help
Similarly S.obj true: false
fails to parse.
If I update the NullLiteral to be defined as :
NullLiteral
/\b(null)\b/ ->
return { $loc, token: $1 }
The nullable issue goes away, but things break if I add wordbreak boundaries to other literals like true/false. Perhaps there is a better/recommended way to handle this in hera ?
Issue Analytics
- State:
- Created 9 months ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Parser Error: Unexpected token {, expected identifier or keyword
1 Answer 1 · How to achieve this in typescript <div *ngFor="let Schema of buttonSchema?.layoutsections"> <div *ngFor="let Schema1 of Schema?.
Read more >How to Solve Parsing Errors in Python? - Smartproxy
Common Python syntax errors · Missing the semicolon · Misusing the assignment operator · Using parentheses, brackets, and quotes · Missing the comma....
Read more >Inline keyword call syntax · Issue #3187 · robotframework ...
Having inline keyword call syntax would be nice. It would allow using keywords in places where currently you'd normally just have plain ...
Read more >awk: Parsing a textfile by using keywords for the layout
How can I use awk to iterate through every line and add the required semicolons if some of the keywords are missing? I...
Read more >Failed to parse field of type in document with id ''. - Opster
A detailed guide on how to resolve errors related to "failed to parse field of type in document with id ''."
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks for the bug report, fixed in 0.5.8!
Actually, looking at
true
andfalse
shows the intended solution here: append the negative lookahead assertionNonIdContinue
.Somewhat related, I notice that
{true: false}
parses fine, so perhaps you can adapt the explicit object literal code to the implicit object literal code.