mirror of
https://github.com/byteworksinc/ORCA-C.git
synced 2025-01-18 18:30:57 +00:00
Report an error for dual commas at end of struct/union initializer.
This covers things like: struct {int a,b;} u = {1,2,,};
This commit is contained in:
parent
c1a188aa95
commit
8ad58b0de7
12
Parser.pas
12
Parser.pas
@ -2697,9 +2697,15 @@ var
|
|||||||
end; {else}
|
end; {else}
|
||||||
if ((ip = nil) or (ip^.itype^.size = 0)) and not braces then
|
if ((ip = nil) or (ip^.itype^.size = 0)) and not braces then
|
||||||
goto 2;
|
goto 2;
|
||||||
{TODO need other code to disallow dual commas before right brace?}
|
if token.kind = commach then begin
|
||||||
if token.kind = commach then
|
NextToken;
|
||||||
NextToken
|
if token.kind = commach then
|
||||||
|
if ip = nil then
|
||||||
|
if braces then begin
|
||||||
|
Error(23);
|
||||||
|
errorFound := true;
|
||||||
|
end; {if}
|
||||||
|
end {if}
|
||||||
else if token.kind <> rbracech then
|
else if token.kind <> rbracech then
|
||||||
ip := nil;
|
ip := nil;
|
||||||
end; {while}
|
end; {while}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user