Eric Promislow:

But it would be cool if LineState
was defined as union{int; void*}, and scintilla provided Finalizers
for each line and the buffer as a whole.

  I would have expected a buffer init / finalize would be sufficient
as the lexer can drop information from lines after any modification
since it is called to lex from there on. A lexer may decide to use a
compact format like [{lineNumber, hereDocDelimiter}, ...] rather than
one int / pointer per line. For the API, there could be a
SCI_SETLEXERDATA(sptr_t),  SCI_GETLEXERDATA() -> sptr_t, Accessor
gains methods for these, LexerModule gains an entry point
ControlFn(int actionCode, sptr_t arg) actionCode is (LEXER_INIT,
LEXER_FINALIZE, ...).

  To minimize changes the ControlFn isn't really needed as the lexer
could notice that LEXERDATA is NULL, and could interpret a call to lex
from 0 to 0 as a signal to deallocate.

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

Reply via email to