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

Allow incorrect braces and brackets in JSON lexer #1497

Merged
merged 3 commits into from Apr 14, 2020

Conversation

pyrmont
Copy link
Contributor

@pyrmont pyrmont commented Apr 12, 2020

The JSON lexer will mark closing braces and brackets as an error if they do not have a matching opening brace/bracket. As checking syntactic correctness is a non-goal of Rouge, this PR instead adds a rule to the :root state to permits these characters.

This fixes #1467.

@pyrmont pyrmont added the needs-review The PR needs to be reviewed label Apr 12, 2020
@pyrmont pyrmont self-assigned this Apr 12, 2020
@pyrmont
Copy link
Contributor Author

pyrmont commented Apr 12, 2020

@chuck-confluent I don't know if this is too late for your use case but I think I've added a way to permit the use of braces/brackets you wanted. What do you think?

@chuck-confluent
Copy link

Thanks @pyrmont ! Which version of Rouge I can look forward to supporting this? I'll just make a note to rebuild my docker image when it's available

@pyrmont pyrmont merged commit e79d864 into rouge-ruby:master Apr 14, 2020
@pyrmont pyrmont deleted the bugfix.json-ignore-paren-errors branch April 14, 2020 00:45
@pyrmont
Copy link
Contributor Author

pyrmont commented Apr 14, 2020

@chuck-confluent This will be part of the next release of Rouge, v3.18.0. That's scheduled for Tuesday 14 April (so today or tomorrow depending on where you're reading this).

@pyrmont pyrmont removed the needs-review The PR needs to be reviewed label Apr 14, 2020
mattt pushed a commit to NSHipster/rouge that referenced this pull request May 21, 2020
The JSON lexer will currently mark closing braces and brackets as an
error if they do not have a matching opening brace/bracket. As checking
syntactic correctness is a non-goal of Rouge, this commit adds a rule
to the `:root` state that permits these characters.
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.

json lexer: How do I disable the highlighting introduced by mismatching braces, brackets, parentheses?
2 participants