Skip to content
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

Give the lexer more tolerance while reading a CODE token #40

Open
dnbln opened this issue Jan 18, 2021 · 2 comments
Open

Give the lexer more tolerance while reading a CODE token #40

dnbln opened this issue Jan 18, 2021 · 2 comments
Labels
enhancement New feature or request

Comments

@dnbln
Copy link
Contributor

dnbln commented Jan 18, 2021

I got tired of seeing something like this while editing action code:

simplescreenrecorder-2021-01-18_18.52.50.mp4

Might have been overkill to implement but it also fails if I put a (, [ or { inside a string literal and don't close it:

simplescreenrecorder-2021-01-18_19.11.23.mp4

So here are a few thoughts to improve it at least:

  • Give it some idea of structural braces(see brace matcher)
  • To some extent parse the rust code(worth looking at the pin and recoverWhile attributes in intellij-rust's rust grammar!)
@AzureMarker
Copy link
Owner

I was just noticing this again today, though mostly when adding a new nonterminal or modifying its grammar. Parsing fails when you have a partial definition (MyNonterminal: MyTyp^ or MyNonterminal: MyType = <name:^).

@dnbln
Copy link
Contributor Author

dnbln commented Jan 18, 2021

In those cases the tokens are correct, just the parser doesn't know how to recover from them. With the CODE it's a different issue, where the lexer thinks the token ends at EOF or too soon (typed one )/]/} too many)

@AzureMarker AzureMarker added the enhancement New feature or request label Feb 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants