[Lazarus] SynEdit lexer dont hilite & char

Martin Frb lazarus at mfriebe.de
Mon Jun 11 20:32:59 CEST 2018


On 11/06/2018 16:57, AlexeyT via Lazarus wrote:
> MartinFb, are you sure & char must not be hilited as .,:= etc? it's 
> black here.

The & has 2 uses in fpc

&101  an octal number
&word  escape the "word"

the latter makes only sense, if "word" is a reserved keyword.
It allows you to do
   var &type: integer;
"type" being a reserved word can normally not be used in this way. But 
the & allows this.

So &type is an identifier same as FooBar. Hence the & is not highlighted.

>
> procedure TRTBSource.SaveToFile(&File:string);
> var
>   Data:TStrings;
> begin
> Data:=TStringList.Create;
> Data.Text:=Text;
> Data.SaveToFile(&File);
> FreeAndNil(Data);
> end;
>



More information about the Lazarus mailing list