Hi,
can anybody help with the regex for capturing a variable for a custom syntax?
- match: '(?:<)[^<].+(?:>)'
scope: variable.other.constant.xys
This one isn’t too bad but it exposes a problem.
A few examples:
01. $eol = <crlf>;
02. $sep = <crlf 2>;
03. $items1 = <get selecteditemsnames <crlf 3>>;
// Yes, the single double quote is intentional in 04.
04. $items2 = <get selecteditemsnames ">;
05. $heredoc = <<<>>>
...
>>>;
It captures the right hand side variable for 01. - 04. fine but also this part of 05.:
<>>>
which is part of a heredoc (and which it shouldn’t capture).
Any idea how to avoid that it captures a part of the heredoc but still works fine for the first four examples?
I don’t use a - match for heredocs in my syntax file because I don’t want it’s content be formatted as e.g. a whole string…