diff --git a/components/codetools/pascalparsertool.pas b/components/codetools/pascalparsertool.pas index 0839798f58..86524107d2 100644 --- a/components/codetools/pascalparsertool.pas +++ b/components/codetools/pascalparsertool.pas @@ -3364,14 +3364,17 @@ procedure TPascalParserTool.ReadHintModifiers; end; end; +var + NeedUndo: boolean; begin - while CurPos.Flag=cafSemicolon do begin + if CurPos.Flag=cafSemicolon then begin ReadNextAtom; - if not IsModifier then begin - UndoReadNextAtom; - exit; - end; + NeedUndo:=true; + end else + NeedUndo:=false; + while IsModifier do begin //debugln(['TPascalParserTool.ReadHintModifier ',CurNode.DescAsString,' ',CleanPosToStr(CurPos.StartPos)]); + NeedUndo:=true; CreateChildNode; CurNode.Desc:=ctnHintModifier; CurNode.EndPos:=CurPos.EndPos; @@ -3386,7 +3389,12 @@ begin if not (CurPos.Flag in [cafSemicolon,cafRoundBracketClose]) then SaveRaiseCharExpectedButAtomFound(';'); EndChildNode; + if CurPos.Flag<>cafSemicolon then + break; + ReadNextAtom; end; + if NeedUndo then + UndoReadNextAtom; end; function TPascalParserTool.KeyWordFuncBeginEnd: boolean;