diff --git a/Parser.pas b/Parser.pas index 2553008..44b03d3 100644 --- a/Parser.pas +++ b/Parser.pas @@ -1896,6 +1896,25 @@ var begin {GetInitializerValue} + if token.kind in [dotch,lbrackch] then begin + {designated initializer: give error and skip over it} + Error(150); + while token.kind in [dotch,lbrackch] do begin + if token.kind = lbrackch then begin + NextToken; + Expression(arrayExpression, [rbrackch]); + if token.kind = rbrackch then + NextToken; + end {if} + else {if token.kind = dotch then} begin + NextToken; + if token.kind in [ident,typedef] then + NextToken; + end {if} + end; {while} + if token.kind = eqch then + NextToken; + end; {if} if variable^.storage = stackFrame then Expression(autoInitializerExpression, [commach,rparench,rbracech]) else diff --git a/Scanner.pas b/Scanner.pas index 82403f9..844500a 100644 --- a/Scanner.pas +++ b/Scanner.pas @@ -672,6 +672,7 @@ if list or (numErr <> 0) then begin 147: msg := @'lint: not all parameters were declared with a type'; 148: msg := @'all parameters must have a complete type'; 149: msg := @'invalid universal character name for use in an identifier'; + 150: msg := @'designated initializers are not supported by ORCA/C'; otherwise: Error(57); end; {case} writeln(msg^);