mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-22 13:39:30 +02:00
codetools: fixed parsing var type deprecated )
git-svn-id: trunk@42844 -
This commit is contained in:
parent
75902ea949
commit
f68c999a04
@ -3366,6 +3366,7 @@ procedure TPascalParserTool.ReadHintModifiers;
|
|||||||
|
|
||||||
var
|
var
|
||||||
NeedUndo: boolean;
|
NeedUndo: boolean;
|
||||||
|
CanHaveString: Boolean;
|
||||||
begin
|
begin
|
||||||
if CurPos.Flag=cafSemicolon then begin
|
if CurPos.Flag=cafSemicolon then begin
|
||||||
ReadNextAtom;
|
ReadNextAtom;
|
||||||
@ -3374,24 +3375,23 @@ begin
|
|||||||
NeedUndo:=false;
|
NeedUndo:=false;
|
||||||
while IsModifier do begin
|
while IsModifier do begin
|
||||||
//debugln(['TPascalParserTool.ReadHintModifier ',CurNode.DescAsString,' ',CleanPosToStr(CurPos.StartPos)]);
|
//debugln(['TPascalParserTool.ReadHintModifier ',CurNode.DescAsString,' ',CleanPosToStr(CurPos.StartPos)]);
|
||||||
NeedUndo:=true;
|
NeedUndo:=false;
|
||||||
CreateChildNode;
|
CreateChildNode;
|
||||||
CurNode.Desc:=ctnHintModifier;
|
CurNode.Desc:=ctnHintModifier;
|
||||||
CurNode.EndPos:=CurPos.EndPos;
|
CurNode.EndPos:=CurPos.EndPos;
|
||||||
if UpAtomIs('DEPRECATED') then begin
|
CanHaveString:=UpAtomIs('DEPRECATED');
|
||||||
ReadNextAtom;
|
ReadNextAtom;
|
||||||
if AtomIsStringConstant then begin
|
if CanHaveString and AtomIsStringConstant then begin
|
||||||
ReadConstant(true,false,[]);
|
ReadConstant(true,false,[]);
|
||||||
CurNode.EndPos:=CurPos.StartPos;
|
CurNode.EndPos:=CurPos.StartPos;
|
||||||
end;
|
end;
|
||||||
end else
|
|
||||||
ReadNextAtom;
|
|
||||||
if not (CurPos.Flag in [cafSemicolon,cafRoundBracketClose]) then
|
if not (CurPos.Flag in [cafSemicolon,cafRoundBracketClose]) then
|
||||||
SaveRaiseCharExpectedButAtomFound(';');
|
SaveRaiseCharExpectedButAtomFound(';');
|
||||||
EndChildNode;
|
EndChildNode;
|
||||||
if CurPos.Flag<>cafSemicolon then
|
if CurPos.Flag<>cafSemicolon then
|
||||||
break;
|
break;
|
||||||
ReadNextAtom;
|
ReadNextAtom;
|
||||||
|
NeedUndo:=true;
|
||||||
end;
|
end;
|
||||||
if NeedUndo then
|
if NeedUndo then
|
||||||
UndoReadNextAtom;
|
UndoReadNextAtom;
|
||||||
@ -4784,7 +4784,8 @@ begin
|
|||||||
SaveRaiseStringExpectedButAtomFound('"of"');
|
SaveRaiseStringExpectedButAtomFound('"of"');
|
||||||
// read all variants
|
// read all variants
|
||||||
repeat
|
repeat
|
||||||
ReadNextAtom; // read constant (variant identifier)
|
// read constant(s) (variant identifier)
|
||||||
|
ReadNextAtom;
|
||||||
{$IFDEF VerboseRecordCase}
|
{$IFDEF VerboseRecordCase}
|
||||||
debugln(['TPascalParserTool.KeyWordFuncTypeRecordCase variant start="',GetAtom,'"']);
|
debugln(['TPascalParserTool.KeyWordFuncTypeRecordCase variant start="',GetAtom,'"']);
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
@ -4798,7 +4799,8 @@ begin
|
|||||||
SaveRaiseCharExpectedButAtomFound(':');
|
SaveRaiseCharExpectedButAtomFound(':');
|
||||||
ReadNextAtom;
|
ReadNextAtom;
|
||||||
until false;
|
until false;
|
||||||
ReadNextAtom; // read '('
|
// read '('
|
||||||
|
ReadNextAtom;
|
||||||
if (CurPos.Flag<>cafRoundBracketOpen) then
|
if (CurPos.Flag<>cafRoundBracketOpen) then
|
||||||
SaveRaiseCharExpectedButAtomFound('(');
|
SaveRaiseCharExpectedButAtomFound('(');
|
||||||
// read all variables
|
// read all variables
|
||||||
@ -4831,9 +4833,14 @@ begin
|
|||||||
ReadNextAtom; // read type
|
ReadNextAtom; // read type
|
||||||
Result:=ParseType(CurPos.StartPos,CurPos.EndPos-CurPos.StartPos);
|
Result:=ParseType(CurPos.StartPos,CurPos.EndPos-CurPos.StartPos);
|
||||||
if not Result then begin
|
if not Result then begin
|
||||||
|
{$IFDEF VerboseRecordCase}
|
||||||
debugln(['TPascalParserTool.KeyWordFuncTypeRecordCase ParseType failed']);
|
debugln(['TPascalParserTool.KeyWordFuncTypeRecordCase ParseType failed']);
|
||||||
|
{$ENDIF}
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
|
{$IFDEF VerboseRecordCase}
|
||||||
|
debugln(['TPascalParserTool.KeyWordFuncTypeRecordCase Hint modifier: "',GetAtom,'"']);
|
||||||
|
{$ENDIF}
|
||||||
ReadHintModifiers;
|
ReadHintModifiers;
|
||||||
CurNode.EndPos:=CurPos.EndPos;
|
CurNode.EndPos:=CurPos.EndPos;
|
||||||
EndChildNode; // close variable definition
|
EndChildNode; // close variable definition
|
||||||
|
Loading…
Reference in New Issue
Block a user