Page 1 of 1

Syntax highlighting query

Posted: Thu Nov 07, 2002 10:56 pm
by Murray
I am using a macro language that has the following constructs -

Variables begin with a "$" and end with a "# "symbol (eg $variable#) and are assigned using a !let statement (eg !let $variable#=1)
Labels begin with a "!" and end with ":rem" (eg !label:rem)
All executable statements begin with "!"

I set up a syntax file to recognise these, using StringStart/End for the variables and CharStart/End for the labels, as below

C=1

[Syntax]
Namespace1 = 6
IgnoreCase = Yes
KeyWordLength = 0
BracketChars = {[()]}
OperatorChars =
PreprocStart =
SyntaxStart =
SyntaxEnd =
HexPrefix =
CommentStart =
CommentEnd =
CommentStartAlt =
CommentEndAlt =
SingleComment = #
SingleCommentCol =
SingleCommentAlt = !rem
SingleCommentColAlt =
SingleCommentEsc =
StringsSpanLines = No
StringStart = $
StringEnd = #
StringAlt =
StringEsc =
CharStart = !
CharEnd = :
CharEsc =

This works well in general, but occasionally it is necessary to assign a path name to a variable (eg !let $path# = 'C:\Temp'). In this case the variable lies between a "!" and a ":" and so is not highlighted correctly. The syntax highlighter interprets it as a label. I tried putting ":rem" as the CharEnd but it doesn't like that.

Any bright ideas?

Regards

Murray