Highlight suffix (eg. methods) or highlight words based on end of word

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

Highlight suffix (eg. methods) or highlight words based on end of word

Postby westerla » Sun Oct 10, 2004 8:29 am

Does anyone know if it is possible to highlight suffixes.
For example method invocations after a dot.
So in "object.new" I would like to highlight "new".
User avatar
westerla
Newbie
 
Posts: 1
Joined: Sat Oct 09, 2004 11:00 pm

Re: Highlight suffix (eg. methods) or highlight words based on end of word

Postby Mofi » Thu Oct 28, 2004 8:52 am

Not really.

Marker characters, for example
/Marker Characters = ". "
can do it, but not very good.

Better is to highlight all words starting with the same character, like

/C5"Methods"
** .


The '.' must be a delimiter character. But you don't really know, if this suffix is really correct written, because it simply highlights all words starting with a point, except floating numbers, because numbers have a higher syntax highlighting priority.

The only perfect solution is, what I use for global structured variables for 'C'. I deleted '.' from the delimiters line and add to the wordfile (and update) all global variables manually with all their structure elements. But this solution cannot be used for C++ with hundreds or thousands methods and elements.
User avatar
Mofi
Grand Master
Grand Master
 
Posts: 4066
Joined: Thu Jul 29, 2004 11:00 pm
Location: Vienna

Re: Highlight suffix (eg. methods) or highlight words based on end of word

Postby GopherBaroque » Tue Dec 18, 2007 11:46 pm

I work with a variant of QuickBasic that allows implicit variable declaration by suffix, for example:

Dim iBand as Integer

may be as

Dim Band%


Is there a way to Syntax Highlight "Band%" in the example above?
(with or without included "%" sign)

thanks, Gopher
N. Seattle, USA
User avatar
GopherBaroque
Newbie
 
Posts: 1
Joined: Tue Dec 18, 2007 12:00 am

Re: Highlight suffix (eg. methods) or highlight words based on end of word

Postby Mofi » Wed Dec 19, 2007 8:40 am

It is not possible to highlight all words ending with a special character. There is also no workaround except all such variables start with always the same character which would make it possible to use marker characters.

You would need to find all words ending with %, create a wordlist and copy this list correct sorted into the wordfile into a color group. But you would need to update this wordlist whenever you add a new variable or delete a variable.

As already written in another thread: Why do you want symbols you have defined yourself if every syntax keyword, strings, comments and operators are already highlighted? If you want "normal" text not black change the color of "normal" text. Or is there another reason why you want these variables highlighted with a non normal text color?
User avatar
Mofi
Grand Master
Grand Master
 
Posts: 4066
Joined: Thu Jul 29, 2004 11:00 pm
Location: Vienna


Return to Syntax Highlighting