Fix handling of square parentheses in velocity lexer #1605
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Bugfix for using
[
within nested parentheses for velocity lexer.Details
I was seeing the following error message:
unknown state: :push!
when using a line similar to this in a .vm file.#set( $result = $foo($bar[$baz]) )
This is being highlighted by
velocity.rb
Looks like this is a result of this rule using
push!
instead ofpush
:rouge/lib/rouge/lexers/velocity.rb
Line 66 in 128abf0
Testing
I have added the line above to
spec/visual/samples/velocity
.I have confirmed that with no change this causes a
unknown state: :push!
error message.After applying my change I have confirmed that this case no longer appears.
Issue link
Raised an issue to track this here: #1604. This commit fixes #1604.
Further work
I have identified that a similar issue MAY be present in
ceylon.rb
rouge/lib/rouge/lexers/ceylon.rb
Line 90 in 1af45d5
I have not amended this, as I don't have the full context on this lexer.