mirror of
https://github.com/byteworksinc/ORCA-C.git
synced 2024-11-17 05:06:10 +00:00
Support designated initialization of anonymous member fields.
As noted previously, there is some ambiguity in the standards about how anonymous structs/unions participate in initialization. ORCA/C follows the model that they do participate as structs or unions, and designated initialization of them is implemented accordingly. This currently has a slight issue in that extra copies of the anonymous member field name will be printed in #pragma expand output.
This commit is contained in:
parent
4621336c3b
commit
39250629bd
11
Parser.pas
11
Parser.pas
@ -2627,8 +2627,15 @@ var
|
||||
ip := ip^.next;
|
||||
if ip = nil then
|
||||
Error(81);
|
||||
NextToken;
|
||||
{TODO if ip is an anonymous member field ...}
|
||||
if ip^.anonMemberField then begin
|
||||
PutBackToken(token, false);
|
||||
token.kind := dotch;
|
||||
token.class := reservedSymbol;
|
||||
token.isDigraph := false;
|
||||
ip := ip^.anonMember;
|
||||
end {if}
|
||||
else
|
||||
NextToken;
|
||||
if token.kind in [dotch,lbrackch] then
|
||||
hasNestedDesignator := true
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user