Discussion:
[Lazarus] SynEdit lexer dont hilite & char
AlexeyT via Lazarus
2018-06-11 14:57:37 UTC
Permalink
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

--
Martin Frb via Lazarus
2018-06-11 18:32:59 UTC
Permalink
Post by AlexeyT via Lazarus
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.
Post by AlexeyT via Lazarus
procedure TRTBSource.SaveToFile(&File:string);
var
  Data:TStrings;
begin
Data:=TStringList.Create;
Data.Text:=Text;
Data.SaveToFile(&File);
FreeAndNil(Data);
end;
--

Loading...