mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-17 04:29:28 +02:00
codetools: fixed parsing array without of
git-svn-id: trunk@35412 -
This commit is contained in:
parent
202cd36b0a
commit
a44a227419
@ -1446,11 +1446,12 @@ begin
|
|||||||
CurNode.Desc:=ctnOpenArrayType;
|
CurNode.Desc:=ctnOpenArrayType;
|
||||||
end;
|
end;
|
||||||
if not Extract then ReadNextAtom else ExtractNextAtom(copying,Attr);
|
if not Extract then ReadNextAtom else ExtractNextAtom(copying,Attr);
|
||||||
if not UpAtomIs('OF') then
|
if not UpAtomIs('OF') then begin
|
||||||
if ExceptionOnError then
|
if ExceptionOnError then
|
||||||
RaiseStringExpectedButAtomFound('"of"')
|
RaiseStringExpectedButAtomFound('"of"')
|
||||||
else
|
else
|
||||||
exit;
|
exit;
|
||||||
|
end;
|
||||||
if not Extract then ReadNextAtom else ExtractNextAtom(copying,Attr);
|
if not Extract then ReadNextAtom else ExtractNextAtom(copying,Attr);
|
||||||
if UpAtomIs('CONST') then begin
|
if UpAtomIs('CONST') then begin
|
||||||
if (phpCreateNodes in Attr) then begin
|
if (phpCreateNodes in Attr) then begin
|
||||||
@ -4151,6 +4152,7 @@ function TPascalParserTool.KeyWordFuncTypeArray: boolean;
|
|||||||
array of ...
|
array of ...
|
||||||
array[SubRange] of ...
|
array[SubRange] of ...
|
||||||
array[SubRange,SubRange,...] of ...
|
array[SubRange,SubRange,...] of ...
|
||||||
|
array[Subrange]; // without "of" means array of byte
|
||||||
}
|
}
|
||||||
begin
|
begin
|
||||||
CreateChildNode;
|
CreateChildNode;
|
||||||
@ -4172,6 +4174,13 @@ begin
|
|||||||
RaiseCharExpectedButAtomFound(']');
|
RaiseCharExpectedButAtomFound(']');
|
||||||
until false;
|
until false;
|
||||||
ReadNextAtom;
|
ReadNextAtom;
|
||||||
|
if CurPos.Flag in [cafSemicolon,cafRoundBracketClose,cafEdgedBracketClose]
|
||||||
|
then begin
|
||||||
|
// array[] without "of" means array[] of byte
|
||||||
|
CurNode.EndPos:=CurPos.StartPos;
|
||||||
|
EndChildNode; // close array
|
||||||
|
exit(true);
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
if not UpAtomIs('OF') then
|
if not UpAtomIs('OF') then
|
||||||
RaiseStringExpectedButAtomFound('"of"');
|
RaiseStringExpectedButAtomFound('"of"');
|
||||||
|
Loading…
Reference in New Issue
Block a user