How to highlight 'range different to range?

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

How to highlight 'range different to range?

Postby palou » Mon Feb 21, 2005 8:28 am

Hi all,

I have a word which is either a keyword or an attribute the difference between the two case is if the word is preceded by a space it's a keyword, if it is preceded by a ' its an attribute.

Does some one know how to make the syntax highlight to correctly handle this case?

Code: Select all
example:
variable   t : integer range 0 to 127;       -- range is a keyword
variable   s : std_logic_vector(sign'range); -- range is an attribute


Thank's,
Alain
User avatar
palou
Basic User
Basic User
 
Posts: 46
Joined: Fri Dec 17, 2004 12:00 am
Location: Geneva / Switzerland

Re: How to highlight 'range different to range?

Postby Mofi » Sun Jul 23, 2006 8:48 am

A really not perfect solution would be to highlight 'range with a marker character specification:

/Marker Characters = "'e"
/C1"keywords"
range
/C2"attributes"
'e

But this would work only if the ' character is used only for 'range and nothing else in the whole file.

The problem here is that there is no other delimiter between sign and 'range. So the ' must be also a delimiter and this makes it impossible to specify 'range as a highlighting "word".
User avatar
Mofi
Grand Master
Grand Master
 
Posts: 4054
Joined: Thu Jul 29, 2004 11:00 pm
Location: Vienna

Re: How to highlight 'range different to range?

Postby palou » Wed Aug 02, 2006 6:14 am

Thank's Mofi for this "not perfect solution" I'll try it.

Regards from Switzerland,
Alain
User avatar
palou
Basic User
Basic User
 
Posts: 46
Joined: Fri Dec 17, 2004 12:00 am
Location: Geneva / Switzerland


Return to Syntax Highlighting