GitLab repository storage has been migrated to hashed layout. Please contact Infrastructure team if you notice any issues with repositories or hooks.

groovy.lang: correctly highlight ${} placeholders with braces in them

Currently, the first closing brace encountered in such a placeholder
is assumed to end it, even if it actually just ends a nested block.
To correct this, treat braced blocks as nested contexts.
parent 70a854a5
......@@ -324,6 +324,19 @@
<context ref="operator"/>
<context ref="null-value"/>
<context ref="boolean"/>
<!--
To be able to tell apart closing braces that end a ${} placeholder
and ones that end a block inside such a placeholder,
treat braced blocks as nested contexts.
-->
<context>
<start>\{</start>
<end>\}</end>
<include>
<context ref="groovy"/>
</include>
</context>
</include>
</context>
</definitions>
......
......@@ -36,7 +36,7 @@ def notSlashy = 1 /2/ 3 // not a slashy string; just two division operators
def dollarSlashy = $/Dollar slashy string.
There are three escape sequences: $$ $/ \
Interpolation works: $_ ${true}
Interpolation works: $_ ${x.collect { it + '\n' }.join('')}
Dollars $ and backslashes \ on their own are interpreted literally./$
0b10i + 0b0110_1011 // binary numbers
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment