Fix for br1004 - fully support class construction in variable initialisation.

This commit is contained in:
Martin Whitaker 2019-10-05 20:10:11 +01:00
parent c9d849ed7b
commit c86dc285cc
1 changed files with 2 additions and 4 deletions

View File

@ -1743,12 +1743,10 @@ variable_decl_assignment /* IEEE1800-2005 A.2.3 */
delete[]$1; delete[]$1;
$$ = tmp; $$ = tmp;
} }
| IDENTIFIER '=' K_new '(' ')' | IDENTIFIER '=' class_new
{ decl_assignment_t*tmp = new decl_assignment_t; { decl_assignment_t*tmp = new decl_assignment_t;
tmp->name = lex_strings.make($1); tmp->name = lex_strings.make($1);
PENewClass*expr = new PENewClass; tmp->expr .reset($3);
FILE_NAME(expr, @3);
tmp->expr .reset(expr);
delete[]$1; delete[]$1;
$$ = tmp; $$ = tmp;
} }