I need to highlight every whole block of code that is inside curly braces, so I created a rule:
<context id="action-body" style-ref="action-body" extend-parent="true">
<start>{</start>
<end>}</end>
<include>
<context ref="builtin-vars" />
<context ref="keywords" />
</include>
</context>
It highlights code, keywords and vars inside correctly, but it of course stops if there is another closing curly bracket inside. I know that it is not trivial for regular expressions to check level of recursion, but may be gtkSourceView
syntax has something special for cases like these?
It is a serious thing, because a language (PegJS, in fact) I am making highlighting for can contain JavaScript code only inside curly braces, not outside. And I want to highlight them with one color exluding :)
Related: