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

error message: unknown state: :push! when using velocity.rb #1604

Closed
domRowan opened this issue Oct 12, 2020 · 1 comment · Fixed by #1605
Closed

error message: unknown state: :push! when using velocity.rb #1604

domRowan opened this issue Oct 12, 2020 · 1 comment · Fixed by #1605
Labels
bugfix-request A request for a bugfix to be developed.

Comments

@domRowan
Copy link
Contributor

domRowan commented Oct 12, 2020

Name of the lexer
velocity.rb

Code sample
A diff to apply to spec/visual/samples/velocity to expose this issue whilst running bundle exec rake

diff --git a/spec/visual/samples/velocity b/spec/visual/samples/velocity
index 644a677d..2ebc45ad 100644
--- a/spec/visual/samples/velocity
+++ b/spec/visual/samples/velocity
@@ -25,4 +25,4 @@ ${customer.Address}
 ${purchase.getTotal(true)}
 $title.set( "Homage to Catalonia" )
 
-
+#set( $result = $foo($bar[$baz]) )

Additional context

Looks like this issue is caused by the use of [ within nested parenthesis.
The smallest possible snippet that will reproduce the issue is #set(([])).

Looks like this is a result of this rule using push! instead of push:

rule %r/[(\[]/, Punctuation, :push!

Further work

I have identified that a similar issue MAY be present in ceylon.rb

rule %r(/\*), Comment::Multiline, :push!

@domRowan domRowan added the bugfix-request A request for a bugfix to be developed. label Oct 12, 2020
@domRowan
Copy link
Contributor Author

PR to fix velocity lexer here: #1605

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix-request A request for a bugfix to be developed.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant