Neil Hodgson wrote:
Robert Roessler:

Exposing a "ColourTo()" member function would obviate the need to use
the original Accessor-based styler at all (for normal styling needs) -
if this would be desirable.  Of course, there is also the possibility
of querying the main properties DB - which also goes through the old
styler.

   Unsure. One of the reasons for StyleContext was to try to get away
from potential confusion and bugs when ColourTo was available. You can
use ForwardSetState when recognizing the end of a lexeme. The two
segment loop (exit state, enter state) as used in LexCPP works quite
well although there are often some other bits needed in the loop.

Follow-ups to my two open issues on this thread:

1) my patched version of StyleContext.h is still available @

http://www.rftp.com/StyleContext.h

This only includes the casting changes already discussed at the start of this thread... while I do not expect the imminent breakage of my lexer if this patch is not accepted, I thought I should re-raise this issue. ;)

2) regarding my suggested "enhancement" of SetState(), I find that, at least with my lexer's processing model, the change doesn't really work out that well... since my model "anchors" the coloring range at the start of the char loop, it becomes an [expected] invariant. Buying into a SetState()-driven model really means accepting coloring ranges being currentPos-relative, which ends up breaking this invariant.

This is not to say that it *couldn't* be a useful change to SetState() - just that I would not be able to use it [easily]. :)

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