Hi,<div> I have started playing with QScintilla few days back and I am quite happy to see broad range of already existing lexers. Now I have a requirement where I am planning to add few keywords into existing lexer. By googling it seems that I have to create a subclass and need to redefine "const char* keywords(int set) const" function. I did that but did not observer any change. Here is my code,</div>
<div><br></div><div><div>class myLex : public QsciLexerCPP</div><div>{</div><div>public:</div><div> const char* keywords(int set) const;</div><div>};</div></div><div><br></div><div><div>const char* myLex::keywords(int set) const</div>
<div>{</div><div> if (set == 1)</div><div> return</div><div> "and and_eq asm auto bitand bitor bool break case "</div><div> "catch char class compl const const_cast continue "</div>
<div> "default delete do double dynamic_cast else enum "</div><div> "explicit export extern false float for friend goto if "</div><div> "inline int long mutable namespace new not not_eq "</div>
<div> "operator or or_eq private protected public register "</div><div> "reinterpret_cast return short signed sizeof static "</div><div> "static_cast struct switch template this throw true "</div>
<div> "try typedef typeid typename union unsigned using "</div><div> "virtual void volatile wchar_t while xor xor_eq"</div><div> "mov";<b> <i>// my new keyword</i></b></div>
<div><br></div><div> if (set == 3)</div><div> return</div><div> "a addindex addtogroup anchor arg attention author b "</div><div> "brief bug c class code date def defgroup deprecated "</div>
<div> "dontinclude e em endcode endhtmlonly endif "</div><div> "endlatexonly endlink endverbatim enum example "</div><div> "exception f$ f[ f] file fn hideinitializer "</div>
<div> "htmlinclude htmlonly if image include ingroup "</div><div> "internal invariant interface latexonly li line link "</div><div> "mainpage name namespace nosubgrouping note overload "</div>
<div> "p page par param post pre ref relates remarks return "</div><div> "retval sa section see showinitializer since skip "</div><div> "skipline struct subsection test throw todo typedef "</div>
<div> "union until var verbatim verbinclude version warning "</div><div> "weakgroup $ @ \\ & < > # { }";</div><div><br></div><div> if (set == 16)</div><div> return "mdef mend"; <b><i>// my new keywords</i></b></div>
<div> return 0;</div><div>}</div></div><div><br></div><div><br></div><div><br></div><div>Please let me know in case I have missed something.</div><div><br></div><div>Also I wanted to play with existing colour scheme that lexer is following. wondering if it is possible.</div>
<div><br></div><div>Any help, link or suggestion will help a lot.</div><div><br></div><div>thanks </div>