Kein-Hong Man: > Style is 8 bits. I would want to be very careful about how I use > those bits. Hijack the folding bits? Maybe, but that's a rather > bad way to implement things. Finally, I wouldn't want to go into > storing state information in the lexer itself.
There is an extra 32 bit word of per line lexer state available through styler.GetLineState / SetLineState. SinkWorld does store extra data in the lexer but there lexers are instances allocated per document. Scintilla does not expose a document ID in a way that could be used as a key for the lexer's own data although I have offered to add this in the past if someone really needs it. To work properly there would need to be a call to the lexer when the document is deallocated or changes lexer. > I'm not really worried about implementation or performance; my > focus is on how to lex Perl code properly -- find a proper > solution, and only then see how it can be implemented. Anyway, > both using state and using lookbacks are possible solutions, > obviously neither is 'wrong', so anyone who wants to take a stab > at redoing the lexer is welcome to do so. Performance shouldn't be a concern here. One possible simplification technique would be to always start lexing from the beginning of the document for Perl. This would avoid any need for backtracking or finding somewhere to stash state. Neil _______________________________________________ Scintilla-interest mailing list [email protected] http://mailman.lyra.org/mailman/listinfo/scintilla-interest
