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.
was a "non per-line" approach already studied?
it seems to me that storing metadata for each character or for each line is sometimes overkill and sometimes not enough. I'm pretty sure that executing lexing on the fly for a few hundreds or thousands characters is almost always costless [and a cache could be used] My idea is that lexing states could be stored (approximately) each N bytes/characters and lexing could be only pure-dynamic. For sure, this approach would imply some kind of lexing states structure which would arrange itself with insertions / deletions of text [not absolutely trivial, but there could be far less entries than lines in fact so maybe a simple position+pointer array could do the job, keeping run time similar to that of line vector]. For sure the ability to put indicators in an hand-coded way should be kept, but would need reorganization for best profit.

this approach would use far less memory, be somewhat similar in run time in worst case (and be much better in some others) and would allow arbitrary number of styles as they would not be stored...

just my 2 cents.
Armel


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

Reply via email to