Neil Hodgson wrote:
  I'm a little surprised that you didn't want a mechanism for storing
extra lexer state. The standard byte wide style buffer quickly runs
out of states and the per-line style integer can be limiting so I've
thought in the past about providing lexer entry points for allocating
and deallocating per-document lexer state.

  Neil

That's what I implemented.  UDL maintains its own state machine
that sits apart from the Scintilla styles.  It allows up to 2^25
states (reserving 6 bits for a hash of a heredoc delimiter).  From
the user's Luddite program it calculates which UDL states are safe
to resume lexing at the start of a line (e.g. strings are not safe,
as you need to move arbitrarily back to find the delimiter).

I had a developer who once casted the LineState to (void *) so he
could store complete heredoc delimiters in it.  We had an interesting
memory leak with that approach.  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.

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

Reply via email to