Armel Asselin:
I would tend to say that syntax colouring could at least for some languages have a notion of 'resynchronization' points, allowing to go anywhere in a file, parse back until a synchronization point is found, then parsed ahead up to end of the screen as usual. those resynchronization points are location in a source file where you're sure that you are in a given (default) state, a given lexer knows how to find those points if any.
Some languages such as line-oriented languages may have strong resynchronization points but it is difficult for languages with multi-line strings and comments such as C. If you start in the middle of a C file, you don't know if you are in a comment. You can seek back but even if you find a /*, you don't know if you have reached the start of a comment since /* /* */ is all a single comment in C. You could scan the code to establish the boundaries of comments and this scan may be quicker than a full lex but to determine that a /* starts a comment then you also have to know that it is not inside a string or a single line comment. Once you are able to accurately determine the nature of /*, you have already performed a large part of the work of a full lex. Possibly the saving is worth the effort but its not obvious that it is. The OP should try 1.73 since there was some work in this area in 1.72. Its easier to try the new version than it is to analyze the reported problems. Neil _______________________________________________ Scintilla-interest mailing list [email protected] http://mailman.lyra.org/mailman/listinfo/scintilla-interest
