On 08/10/2010 19:58, Sven Barth wrote:
On 08.10.2010 20:52, Mattias Gaertner wrote:
On Fri, 08 Oct 2010 20:39:27 +0200
Sven Barth<[email protected]>  wrote:

[...]
The only troubles make hybrids like "index" and "message".

Actually they are more simple than you think. They are highlighted by
the synedit highlighter correct.
The trouble makers are postfix modifiers like 'default' and 'cvar'.

But why do we need to highlight those two like Delphi does? Why does "index" need to be bold if it's in "Foo[Index: Integer]" if I'd expect it to be highlighted only in "Bar index 34"? Why does "message" need to be highlighted everywhere if it is a keyword only in "procedure Foo(aMsg: TMsgRec); message Bar;"?

Actually "index" and "message" are probably easy to fix.

"deprecated" and friends are a bit more complex, because they may be behind the ";" (property) or within the declaration/before the ";" (var a:byte deprecated;) It still is easy to implement, but it adds a lot of extra states that the highlighter (seen as state engine) can be in. (those few alone are probably not enough to cause any issues, but I had speed issues before, when adding too many states)

real bugger though is "class"
   type
     a=class; // forward declaration

because it should not be fold-able, but it is
   type
     a=class
     // have some nice multiline comment
     //
    ; // and the semicolon

because on the line "a=class" you can not tell the difference. (unless you scan forward, but that means you have to scan twice)

---
Overall there are a few other things on my todo, before I revisit the highlighter.

Martin

--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to