Skip to content

Commit 76489c6

Browse files
committed
Support for new-style initializers in expressions
(this doesn't change the generated code at this point, but reduces parsing errors)
1 parent a1125c8 commit 76489c6

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

generator/parser/parser.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3712,6 +3712,17 @@ bool Parser::parsePrimaryExpression(ExpressionAST *&node)
37123712
CHECK(')');
37133713
break;
37143714

3715+
case '{':
3716+
nextToken();
3717+
3718+
// support for new-style initializers
3719+
if (token_stream.lookAhead() != '}' && !parseExpression(ast->sub_expression)) {
3720+
return false;
3721+
}
3722+
3723+
CHECK('}');
3724+
break;
3725+
37153726
default:
37163727
if (!parseName(ast->name, true)) // this can also be a template
37173728
return false;

0 commit comments

Comments
 (0)