Developer forums (C::B DEVELOPMENT STRICTLY!) > Development
Extending the CPP Lexer
Folco:
Malc -> perhaps you have not to modify all these files. Look into them. I don't remember exactly because I rewrote a lexer from scratch for me, and you just want to modify an existing one.
Malc:
--- Quote from: Alpha on July 15, 2012, 06:56:25 am ---There are other modifications. Follow the variable keywords2 around LexCPP.cxx and do a threaded searches for SCE_C_WORD2 and wxSCI_C_WORD2. That should provide an example, and the locations for modifications.
--- End quote ---
--- Quote from: Folco on July 15, 2012, 09:03:21 am ---Malc -> perhaps you have not to modify all these files. Look into them. I don't remember exactly because I rewrote a lexer from scratch for me, and you just want to modify an existing one.
--- End quote ---
Thank you both!
Malc
Alpha:
Wait! No programming of the lexer necessary! Add:
--- Code: --- <Style name="Global classes and typedefs"
index="19"
fg="190,0,190"
bold="1"/>
--- End code ---
to lexer_cpp.xml, then list your words in
--- Code: --- <Set index="3"
value="my list of keywords"/>
--- End code ---
or in the set labeled "4" inside the highlighting settings.
carra:
Thanks Alpha! Works like a charm. Very interesting for highlighting domain vocabulary in custom projects.
Malc:
--- Quote from: Alpha on July 17, 2012, 06:18:30 pm ---Wait! No programming of the lexer necessary! Add:
--- End quote ---
AWESOME! Thank you Alpha, that works awesomely! I am at a loss why we need to deal with 3 different numbers (19,3,4) for indexing, but nevertheless, very nice :)
I don't suppose you know to change something like:
#define SOMEVAR(x) somefunc(x)
to just be
#define SOMEVAR(x) somefunc(x)
It seems to want to highlight the whole line.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version