* Operator support

git-svn-id: trunk@195 -
This commit is contained in:
daniel 2005-06-04 16:17:39 +00:00
parent 3ece6aa385
commit e3aef781eb

View File

@ -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);