Philippe Lhoste wrote:
Robert Roessler wrote:
You might look at the LexCaml source - specifically, the handling for the SCE_CAML_IDENTIFIER case element.

Whenever it looks like we have hit a token which *could* be either an identifier *or* a keyword, it is initially colored as an identifier. Then, when we come to the end of the token, we check to see if it has a match in any of the 3 keyword lists. If so, then we recolor it (by changing the state/color) as a keyword of the appropriate color.

Thank you, but for the quick look I took, it seems to be the classical sc.ChangeState() happening just after we quit the identifier state, ie. on first non-word char found after this identifier. ChangeState can only change the latest give state, on the current segment, ie. from the latest SetState.

I need to recolorize a full segment, which can have various styles already, often after meeting other styles as well:

MsgBox = value <--- We meet DEFAULT spaces before finding the = that tell to recolorize MsgBox from COMMAND (back) to IDENTIFIER.

This+Is*A.Legal/Label!:: <-- When I see the double colon, I must recolorize the whole segment as label...

Yes, that does look nasty... but does your recoloring need to [possibly] go back over line boundaries, or will it always be confined to a single line? If the single-line case, then it just can't be that bad, since you have already typed the tokens you need to scan back over - even if you will be recoloring them when you find the first one in your sequence.

Robert Roessler
[EMAIL PROTECTED]
http://www.rftp.com
_______________________________________________
Scintilla-interest mailing list
[email protected]
http://mailman.lyra.org/mailman/listinfo/scintilla-interest

Reply via email to