Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Keywords trip up the parser in unexpected ways

See original GitHub issue

There 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 :

  /\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:closed
  • Created 9 months ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

STRd6commented, Dec 22, 2022

Thanks for the bug report, fixed in 0.5.8!

edemainecommented, Dec 22, 2022

Actually, looking at true and false shows the intended solution here: append the negative lookahead assertion NonIdContinue.

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found