[Lazarus] Syntax highlighting anomalies

Mattias Gaertner nc-gaertnma at netcologne.de
Fri Oct 8 20:47:39 CEST 2010


On Fri, 08 Oct 2010 20:23:08 +0200
Bernd Kreuss <prof7bit at googlemail.com> wrote:

> Hi,
> 
> is it only me ore are there others who find the following behaviors of
> the pascal syntax highlighter in lazarus strange and inconsistent and
> sometimes even annoying?
> 
> * some types (String and AnsiString)  are highlighted, all other types
> (built in or not) are not highlighted. IMHO no type names should be
> highlighted.

String is a keyword. You can not redefine it.
Ansistring is for historical reasons highlighted as keyword too.

 
> * all reserved words for control flow (for, to, if, then, do, else,
> repeat, until, while, begin, end, try, except, finally, raise, goto) are
> highlighted, the only ones that are not highlighted are break, continue
> and exit. IMHO all such reserved words that describe the program
> structure should be highlighted. For example break and exit are of the
> same caliber as raise (or even goto) and also used for similar design
> patterns, I don't see why they should be treated differently.

break, continue and exit are not keywords. They could be
redefined.

 
> I have tried to think about it long and hard but I cannot find any
> reason that would justify these anomalies other than maybe some
> historical reasons. For example a (hypothetical) reason that string is
> internally working in a different way than a Double or an Integer IMHO
> does not justify any different syntax highlighting, they all still
> belong into the same *category*: they appear in var declarations as type
> names and are used like type names everywhere no different than any
> other type name, so they consequently should look like type names and
> not like language keywords.

I'm sure Martin is already thinking about making this optional. ;)

Mattias




More information about the Lazarus mailing list