Ya, I changed the lexer and "fixed" it.  I also noticed that in the CPP
lexer there is are several checks for sc.atLineEnd.  That check will never
return true because the sc.More() function that the state machine is driven
off always returns (currentPos < endPos) so it will never be equal or true.
I "fixed" that too. :)

Darren

> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf Of 
> Robert Roessler
> Sent: Sunday, March 05, 2006 5:38 PM
> To: Discussion of the Scintilla editing component
> Subject: Re: [scintilla] CPP Lexer Question
> 
> Darren Schroeder wrote:
> > I need to syntax highlight cpp files that have only one 
> word in them.  
> > They're valid cpp keywords like 'long' but, in that 
> example, if there 
> > are only those four chars in the file it doesn't get 
> highlighted.  If 
> > I put a space or a carriage return then of course it gets 
> highlighted 
> > but for my purpose I can't put any extra chars in the file. 
>  Any idea 
> > how to overcome this obstacle?
> 
> I expect you will need to change the lexer... but you might 
> want to think about that.
> 
>  From my own perspective, this is something of a design issue 
> with lexers (or syntax-colorers) in general: one style is to 
> not attempt recognition of tokens [as anything special] until 
> a "definite" 
> delimiter is seen.
> 
> This has the "advantage" that a short token like "if" is not 
> initially seen as a keyword, but then changed *back* to an 
> identifier when the user finishes what they were typing 
> ("if_eof")... the drawback being that a token is *not* 
> recognized/colored until a delimiter is seen.
> 
> The other style (obviously) is where token recognition is 
> attempted as every character is seen - which would solve your 
> problem, but... ;)
> 
> Robert Roessler
> [EMAIL PROTECTED]
> http://www.rftp.com
> _______________________________________________
> Scintilla-interest mailing list
> [email protected]
> http://mailman.lyra.org/mailman/listinfo/scintilla-interest
> 

_______________________________________________
Scintilla-interest mailing list
[email protected]
http://mailman.lyra.org/mailman/listinfo/scintilla-interest

Reply via email to