User Defined Lanaguage - creating a style for LABEL names ending with colon ':'
-
Hi
I’m trying to create a User Defined Language,
However have run into a problem with a style I’m trying to implement.
the Language has defined LABELS which end in the ‘:’ colon character.
Much like the Windows Batch files where the label starts with a ‘:’.I cannot get npp to implement this either as a comment or anything else I’ve tried.
Is their any articles out there for this?
-
You just want it to be “any token that ends in a
:
should be considered a LABEL”? Yeah, the User Defined Language lexer isn’t designed to be that complicated: it is intended for a specific list of keywordsThe EnhanceAnyLexer plugin will allow you to add a regex to change the foreground of matching text on a per language (per UDL, or per builtin lexer). Assuming that the LABEL has to be the first non-whitespace sequence on a line, and must be only alphanumeric-and-underscore-before-
:
, then the following should make your LABEL green.[your_udl_name_here] 0x00CC00 = ^\h*\w+: