diff --git a/components/codetools/pascalparsertool.pas b/components/codetools/pascalparsertool.pas index 5534be220f..ab9560df5c 100644 --- a/components/codetools/pascalparsertool.pas +++ b/components/codetools/pascalparsertool.pas @@ -3531,6 +3531,8 @@ begin ParseType(CurPos.StartPos,CurPos.EndPos-CurPos.StartPos); end; ReadConstExpr; + // optional: hint modifier + ReadHintModifier; end; procedure TPascalParserTool.ReadTypeNameAndDefinition; @@ -4483,6 +4485,9 @@ begin and (not IsKeyWordInConstAllowed.DoIdentifier(@Src[CurPos.StartPos])) and AtomIsKeyWord then RaiseStringExpectedButAtomFound('constant'); + if (CurPos.Flag = cafWord) and + (UpAtomIs('DEPRECATED') or UpAtomIs('PLATFORM') + or UpAtomIs('UNIMPLEMENTED') or UpAtomIs('EXPERIMENTAL')) then Break; if (CurPos.Flag = cafSemicolon) then break; CurNode.EndPos := CurPos.EndPos; ReadNextAtom; diff --git a/components/codetools/pascalreadertool.pas b/components/codetools/pascalreadertool.pas index b841e3e078..a21d2fbdb4 100644 --- a/components/codetools/pascalreadertool.pas +++ b/components/codetools/pascalreadertool.pas @@ -1487,7 +1487,8 @@ begin end; end; - ctnVarDefinition,ctnConstant,ctnTypeDefinition,ctnGenericType: + ctnVarDefinition,ctnConstant,ctnConstDefinition, + ctnTypeDefinition,ctnGenericType: begin Node:=FindTypeNodeOfDefinition(Node); if Node=nil then exit;