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

Fix erroneous brace matching rule in JavaScript lexer #1526

Merged
merged 1 commit into from May 30, 2020

Conversation

pyrmont
Copy link
Contributor

@pyrmont pyrmont commented May 30, 2020

The JavaScript lexer contains a bug in the :statement state. This state contains a rule for lexing braces but this rule prevents Rouge from ever leaving the :object state.

While this does not manifest itself in visible errors in most situations, it has the potential to cause subtle bugs and does not fit the mental model a user would have trying to understand how the
JavaScript lexer is implemented.

This PR fixes the problem by removing the rule.

@pyrmont pyrmont added the needs-review The PR needs to be reviewed label May 30, 2020
@pyrmont pyrmont merged commit 089a1e0 into rouge-ruby:master May 30, 2020
@pyrmont pyrmont deleted the bugfix.javascript-closing-braces branch May 30, 2020 18:29
@pyrmont pyrmont removed the needs-review The PR needs to be reviewed label May 30, 2020
mattt pushed a commit to NSHipster/rouge that referenced this pull request May 19, 2021
The JavaScript lexer contains a bug in the `:statement` state. This
state contains a rule for lexing braces but this rule prevents Rouge
from ever leaving the `:object` state.

While this does not manifest itself in visible errors in most
situations, it has the potential to cause subtle bugs and does not fit
the mental model a user would have trying to understand how the
JavaScript lexer is implemented.

This commit fixes the problem by removing the rule.
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.

None yet

1 participant