mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-11-10 22:39:32 +01:00
* Operator support
git-svn-id: trunk@195 -
This commit is contained in:
parent
3ece6aa385
commit
e3aef781eb
@ -1522,22 +1522,24 @@ function TPasParser.ParseProcedureOrFunctionDecl(Parent: TPasElement;
|
|||||||
var
|
var
|
||||||
Name: string;
|
Name: string;
|
||||||
begin
|
begin
|
||||||
Name := ExpectIdentifier;
|
|
||||||
case proctype of
|
case proctype of
|
||||||
pt_function:
|
pt_function:
|
||||||
begin
|
begin
|
||||||
|
Name := ExpectIdentifier;
|
||||||
Result := TPasFunction(CreateElement(TPasFunction, Name, Parent));
|
Result := TPasFunction(CreateElement(TPasFunction, Name, Parent));
|
||||||
Result.ProcType := Engine.CreateFunctionType('', 'result', Result, true,
|
Result.ProcType := Engine.CreateFunctionType('', 'result', Result, true,
|
||||||
Scanner.CurFilename, Scanner.CurRow);
|
Scanner.CurFilename, Scanner.CurRow);
|
||||||
end;
|
end;
|
||||||
pt_procedure:
|
pt_procedure:
|
||||||
begin
|
begin
|
||||||
|
Name := ExpectIdentifier;
|
||||||
Result := TPasProcedure(CreateElement(TPasProcedure, Name, Parent));
|
Result := TPasProcedure(CreateElement(TPasProcedure, Name, Parent));
|
||||||
Result.ProcType := TPasProcedureType(CreateElement(TPasProcedureType, '',
|
Result.ProcType := TPasProcedureType(CreateElement(TPasProcedureType, '',
|
||||||
Result));
|
Result));
|
||||||
end;
|
end;
|
||||||
pt_operator:
|
pt_operator:
|
||||||
begin
|
begin
|
||||||
|
name := tokeninfos[curtoken];
|
||||||
Result := TPasOperator(CreateElement(TPasOperator, Name, Parent));
|
Result := TPasOperator(CreateElement(TPasOperator, Name, Parent));
|
||||||
Result.ProcType := Engine.CreateFunctionType('', '__INVALID__', Result, true,
|
Result.ProcType := Engine.CreateFunctionType('', '__INVALID__', Result, true,
|
||||||
Scanner.CurFilename, Scanner.CurRow);
|
Scanner.CurFilename, Scanner.CurRow);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user