Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2018-06

SynEdit lexer dont hilite & char

2 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

AlexeyT
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

Reply by email

Martin Frb
to AlexeyT
AlexeyT 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.

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

Reply by email