mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-07 18:50:25 +02:00
* Fix operator as identifier after type
git-svn-id: trunk@37347 -
This commit is contained in:
parent
a26ac7dc91
commit
3cc6537345
@ -2943,7 +2943,7 @@ begin
|
||||
CurBlock := declNone;
|
||||
while True do
|
||||
begin
|
||||
if CurBlock in [DeclNone,declConst] then
|
||||
if CurBlock in [DeclNone,declConst,declType] then
|
||||
Scanner.SetTokenOption(toOperatorToken)
|
||||
else
|
||||
Scanner.UnSetTokenOption(toOperatorToken);
|
||||
@ -3028,6 +3028,7 @@ begin
|
||||
end;
|
||||
tkIdentifier:
|
||||
begin
|
||||
Scanner.UnSetTokenOption(toOperatorToken);
|
||||
SaveComments;
|
||||
case CurBlock of
|
||||
declConst:
|
||||
|
@ -169,6 +169,7 @@ type
|
||||
Procedure TestFunctionAlias;
|
||||
Procedure TestOperatorTokens;
|
||||
procedure TestOperatorNames;
|
||||
Procedure TestAssignOperatorAfterObject;
|
||||
Procedure TestFunctionNoResult;
|
||||
end;
|
||||
|
||||
@ -1291,6 +1292,24 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TTestProcedureFunction.TestAssignOperatorAfterObject;
|
||||
begin
|
||||
Add('unit afile;');
|
||||
Add('{$mode delphi}');
|
||||
Add('interface');
|
||||
Add('type');
|
||||
Add(' TA =object');
|
||||
Add(' data:integer;');
|
||||
Add(' function transpose:integer;');
|
||||
Add(' end;');
|
||||
Add('');
|
||||
Add('operator := (const v:Tvector2_single) result:Tvector2_double;');
|
||||
Add('implementation');
|
||||
EndSource;
|
||||
Parser.Options:=[po_delphi];
|
||||
ParseModule;
|
||||
end;
|
||||
|
||||
procedure TTestProcedureFunction.TestFunctionNoResult;
|
||||
begin
|
||||
Add('unit afile;');
|
||||
|
Loading…
Reference in New Issue
Block a user