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

Avoid infinite loop in lexer on unclosed code block #444

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

edwintorok
Copy link

An unclosed code block will cause the lexer to loop infinitely in the 'block' rule, because 'eof' is part of the 'eol' rule and it'll keep matching the last rule.

Add a separate rule for eof that terminates immediately, the way the first rule was written it would expect closing quotes after eof which would never match eof.

An unclosed code block will cause the lexer to loop infinitely in the
'block' rule, because 'eof' is part of the 'eol' rule and it'll keep
matching the last rule.

Add a separate rule for eof that terminates immediately,
the way the first rule was written it would expect closing quotes after
eof which would never match eof.

Signed-off-by: Edwin Török <[email protected]>
@patricoferris
Copy link

This should fix #420 -- We hit this in Eio whilst debugging some other issues, would be a good thing to have merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants