Philippe Lhoste wrote:
Robert Roessler wrote:
Before I wrote the one for OCaml, I had some of the same issues as you - why isn't this more flexible/useful/what I want? But then you realize after studying it that real languages are full of special and/or weird cases (WRT syntax coloring) and are not really amenable to being handled by some sort of regular expression -based solution (which is what some of the "universal" lexers constructed have tried to do).

Well, RegExes are not the only way to make generic lexers:
[snip]
I think, like you, that specialized lexers are a good thing, as they are powerful and able to handle subtle syntax rules. But having a generic mechanism to create new lexers, either temporary (waiting somebody to write a compiled lexer) or definitively (if language is simple -- most LexOthers lexers for example, or if the users are happy enough with it) would be really beneficial for Scintilla (and SciTE!), making it more usable for those wanting to use it for some rare language but having no C++ knowledge, even less a C++ compiler, to create yet another lexer.

It would be nice if there is a simple mechanism for extending existing lexers. Say, colour all wx* identifiers in a certain way, or add new keyword sets without needing to recompile. For long pieces of code with lots of long identifiers (GTK+ code for example), I for one would appreciate the improved readability.

Well, if this generic lexer would be good enough, we could even remove lot of rarely used, hard-coded lexers, to reduce overall size of SciLexer.dll (at least for private use), like do Notepad2 and Notepad++ (creative names...). I know I can already, but I never know when I need to look at a crontab, an Eiffel listing or an Inno script.

Now, if making this generic lexer business was so easy, we would have it since a long time in Scintilla!

--
Cheers,
Kein-Hong Man (esq.)
Kuala Lumpur, Malaysia

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

Reply via email to