Codetools: Fix hint directives after vars and consts in PascalReader. Issue #19614, patch from Anton

git-svn-id: trunk@31952 -
This commit is contained in:
juha 2011-08-11 21:37:30 +00:00
parent 59c2d2e1b6
commit 1cb3753a6f
2 changed files with 7 additions and 1 deletions

View File

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

View File

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