From ca9e805a116189f667dd77c6ee2eac48817a1a55 Mon Sep 17 00:00:00 2001 From: Dom Rowan Date: Mon, 12 Oct 2020 13:58:03 +0100 Subject: [PATCH] Fix handling of square parentheses in velocity lexer --- lib/rouge/lexers/velocity.rb | 2 +- spec/visual/samples/velocity | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/rouge/lexers/velocity.rb b/lib/rouge/lexers/velocity.rb index 2ba0ee1a38..4aa23ad44c 100644 --- a/lib/rouge/lexers/velocity.rb +++ b/lib/rouge/lexers/velocity.rb @@ -63,7 +63,7 @@ class Velocity < TemplateLexer rule %r/0[xX][0-9a-fA-F]+[Ll]?/, Num::Hex rule %r/\b[0-9]+\b/, Num::Integer rule %r/(true|false|null)\b/, Keyword::Constant - rule %r/[(\[]/, Punctuation, :push! + rule %r/[(\[]/, Punctuation, :push rule %r/[)\]}]/, Punctuation, :pop! end end diff --git a/spec/visual/samples/velocity b/spec/visual/samples/velocity index 644a677ddf..698dad3f53 100644 --- a/spec/visual/samples/velocity +++ b/spec/visual/samples/velocity @@ -20,6 +20,7 @@ #end #set( $monkey.Say = ["Not", $my, "fault", 10, false, null] ) ## ArrayList +#set( $result = $foo($bar[$baz]) ) ${mudSlinger} ${customer.Address} ${purchase.getTotal(true)}