How to implement a UDL definition to include everything on the left side of an = sign?
-
I’ve been trying to mess with this for awhile now, attempting to use the ((EOL)) modifier and such things to compose a delimiter that starts with an ((EOL)) and ends with = but it doesn’t seem that ((EOL)) can be used in the Open section of a delimiter - it just fails. Is there any other way I might accomplish this? Kind’ve at a loss, and I’m getting a bit frustrated. Thank you in advance, and I’m sorry if this question has been answered elsewhere - I couldn’t figure out the search criteria to allow me to hit on what I’m looking for without parsing a big list of returns.
-
UDL is not all-powerful: it focuses on defining a list of keywords, rather than arbitrary pattern matches, for syntax highlighting, so it cannot do what you want.
However, the EnhanceAnyLexer plugin can apply the power of regex to change the foreground color of certain text; so you could install that plugin, define most of your language with the UDL interface; then, to get things to the left of an
=
to be a different color, use Plugins > EnhanceAnyLexer > Enhance Current Language, which will add or edit a section in its config file for your current language: the section will start with[NameOfUDLhere]
, and then consist of “color = regex” pairs (if the colors are in hex, it’s 0xBBGGRR for the blue, green, and red portions), along with a config line for “excluded_styles = …” which you probably don’t need to worry about)For my example, since I’m just using the dummy “Default Langauge” (which internally is labled as
udf
), I can use the following config section to get it to highlight text on the left of the=
with brownish-orange:[udf] 0x66ad1 = ^.*(?=\=)