Highlighting strings

Syntax highlighting, code folding, brace matching, code indenting, and function list

Highlighting strings

Postby Jekub » Thu Nov 25, 2004 5:25 am

I'm trying to create a wordfile and am running into a small problem...

I'd like "normal" strings like

"The cat sat on the mat"

to be one color but strings that contain a predefined method name in the language to be a different color e.g.

"LookupMessage"

At the moment if I place the built-in methods into the word list they either are ignored as part of the string (if Noquote is set) or all the strings are parsed for all words (which is always a problem seeing as if, try, and etc. are fairly common in the English language :wink: ) has anyone managed to make this work?
User avatar
Jekub
Newbie
 
Posts: 1
Joined: Thu Nov 25, 2004 12:00 am

Re: Highlighting strings

Postby Mofi » Sun Nov 28, 2004 9:39 am

The same problem appears in HTML. There are attributes, which have predefined values like valign="top", and attributes with any text like alt="UltraEdit Logo".

It is not possible to highlight any text strings with string color and predefined strings with an other color, if both have the same string definition character. I have tried a lot with Noquote and Marker Characters, but found no good solution for predefined attribute values within double quotes.

For my personal use, I now write predefined values in HTML within single quotes like valign='top' and any other strings in double quotes. This is valid for HTML. With this trick, the predefined attributes of my HTML-files are highlighted as I want. Maybe your language also allows a second string definition character.

If not, I suspect there is no solution for your highlighting problem.
User avatar
Mofi
Grand Master
Grand Master
 
Posts: 4039
Joined: Thu Jul 29, 2004 11:00 pm
Location: Vienna


Return to Syntax Highlighting