|
From: | Alexey Toptygin |
Subject: | Re: [Nano-devel] aggressive C color highlighting |
Date: | Wed, 2 Aug 2006 20:13:16 +0000 (UTC) |
On Wed, 2 Aug 2006, David Lawrence Ramsey wrote:
By letting earlier rules call 'dibs' on regions they've already matched, we would emulate what the C lexer is doing: if a // comment starts, the rest of the line is not processed in any way; if a /* comment starts, no other processing will be done until the first */. This lets us define complex syntaxes, and handle pathological cases correctly: the same way that a C (or other) compiler would. In theory, this could also save nano some effort, since no more tests will need to be done once the first one matches and the regexes can be simpler.Interesting idea. However, there are some cases where overlaps are needed. How should a regex that allows overlaps be indicated?
What cases would require overlaps? Can you give an example? Presumably, every piece of text should only be one color, and match one regex.
Also, there's still a problem with the feature freeze, as there doesn't appear to be any way to implement this without a massive rewrite of the color code in edit_draw().
That's true, but I think a rewrite will be necessary to get fully featured highlighting. I don't have time now, but I'd be glad to look at it once the freeze ends (presumably in a few months?).
Alexey
[Prev in Thread] | Current Thread | [Next in Thread] |