[Lazarus] SynEdit lexer dont hilite & char

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[Lazarus] SynEdit lexer dont hilite & char

Free Pascal - Lazarus mailing list
MartinFb, are you sure & char must not be hilited as .,:= etc? it's
black here.

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

--
Regards,
Alexey

--
_______________________________________________
Lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] SynEdit lexer dont hilite & char

Free Pascal - Lazarus mailing list
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;
>

--
_______________________________________________
Lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus