diff --git a/packages/fcl-passrc/src/pparser.pp b/packages/fcl-passrc/src/pparser.pp index f6ecdb06f8..2bdaaba105 100644 --- a/packages/fcl-passrc/src/pparser.pp +++ b/packages/fcl-passrc/src/pparser.pp @@ -5366,11 +5366,10 @@ function TPasParser.ParseProcedureOrFunctionDecl(Parent: TPasElement; ProcType: if Parent is TImplementationSection then begin NextToken; - While CurToken in [tkDot,tkLessThan] do - begin + repeat if CurToken=tkDot then Result:=Result+'.'+ExpectIdentifier - else + else if CurToken=tkLessThan then begin // <> can be ignored, we read the list but discard its content UnGetToken; L:=TFPList.Create; @@ -5381,9 +5380,11 @@ function TPasParser.ParseProcedureOrFunctionDecl(Parent: TPasElement; ProcType: TPasElement(L[i]).Release; L.Free; end; - end; + end + else + break; NextToken; - end; + until false; UngetToken; end; end; @@ -5418,7 +5419,7 @@ begin Result.ProcType := TPasProcedureType(CreateElement(TPasProcedureType, '', Result)) else begin - Result.ProcType := CreateFunctionType('', 'Result', Result, True, CurSourcePos); + Result.ProcType := CreateFunctionType('', 'Result', Result, True, CurTokenPos); if (ProcType in [ptOperator, ptClassOperator]) then begin TPasOperator(Result).TokenBased:=IsTokenBased;