Skip to content
Snippets Groups Projects
Commit 2d84662d authored by benjamin.franksen's avatar benjamin.franksen
Browse files

snc: forbid initializing foreign vars at the syntax level

parent 9477ba37
No related branches found
No related tags found
No related merge requests found
......@@ -179,8 +179,6 @@ subscript(p) ::= LBRACKET INTCON(n) RBRACKET. { p = n; }
declaration(p) ::= basetype(t) init_declarators(ds) SEMICOLON.
{ p = decl_add_base_type(ds, t); }
declaration(p) ::= FOREIGN init_declarators(ds) SEMICOLON.
{ p = decl_add_base_type(ds, mk_no_type()); }
init_declarators(p) ::= init_declarator(x). { p = x; }
init_declarators(p) ::= init_declarators(xs) COMMA init_declarator(x).
......@@ -199,6 +197,14 @@ direct_declarator(p) ::= LPAREN declarator(x) RPAREN.
direct_declarator(p) ::= direct_declarator(x) subscript(s).
{ p = decl_postfix_array(x, s.str); }
declaration(p) ::= FOREIGN declarators(ds) SEMICOLON.
{ p = decl_add_base_type(ds, mk_no_type()); }
declarators(p) ::= declarator(x). { p = x; }
declarators(p) ::= declarators(xs) COMMA declarator(x).
{ p = link_expr(xs, x); }
// Initializer
// Note: comma operator not allowed in 'expr'.
init_expr(p) ::= LPAREN(tc) type_expr(c) RPAREN LBRACE(tx) init_exprs(x) RBRACE.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment