Udl syntax question

I am trying to create a language mode for a new dynamic array language that I have been working on but cannot seem to get it right. I have been trying to convert an existing language definition rather than starting from scratch.

Lines that begin with # are comments but # may be present within expressions at other points on a line.

The syntax

‘^#’ : paint …

doesn’t seem to work but if I just have

‘#’ : paint …

it does work.

Any help would be appreciated.

For the token(s) on the left of the colon separator (referred to as the “match strings” in the UDL docs) to be treated as a regular expression and thus use the caret to force matching at the start of a line, it would need to be specified as

/^#/ : paint ...

or (possibly)

/^\#/ : paint ...

(as I can’t remember off the top of my head whether the hash character has to be escaped). The quotes, which can be either single- or double-quotes, are used for plain string matching in that context.

1 Like