mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-11 19:16:16 +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;
|
||||
end;
|
||||
if not Extract then ReadNextAtom else ExtractNextAtom(copying,Attr);
|
||||
if not UpAtomIs('OF') then
|
||||
if not UpAtomIs('OF') then begin
|
||||
if ExceptionOnError then
|
||||
RaiseStringExpectedButAtomFound('"of"')
|
||||
else
|
||||
exit;
|
||||
end;
|
||||
if not Extract then ReadNextAtom else ExtractNextAtom(copying,Attr);
|
||||
if UpAtomIs('CONST') then begin
|
||||
if (phpCreateNodes in Attr) then begin
|
||||
@ -4151,6 +4152,7 @@ function TPascalParserTool.KeyWordFuncTypeArray: boolean;
|
||||
array of ...
|
||||
array[SubRange] of ...
|
||||
array[SubRange,SubRange,...] of ...
|
||||
array[Subrange]; // without "of" means array of byte
|
||||
}
|
||||
begin
|
||||
CreateChildNode;
|
||||
@ -4172,6 +4174,13 @@ begin
|
||||
RaiseCharExpectedButAtomFound(']');
|
||||
until false;
|
||||
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;
|
||||
if not UpAtomIs('OF') then
|
||||
RaiseStringExpectedButAtomFound('"of"');
|
||||
|
Loading…
Reference in New Issue
Block a user