diff options
author | John Hodge <tpg@mutabah.net> | 2016-02-26 07:59:46 +0800 |
---|---|---|
committer | John Hodge <tpg@mutabah.net> | 2016-02-26 07:59:46 +0800 |
commit | e73e8d843b57933e041ffff784d46d8db80a84c6 (patch) | |
tree | 4399f213111dbdac3a207d30334dc5598b58447a /src | |
parent | b1b7e4237dee5fdbb280baec3fe7a3b38f6425f7 (diff) | |
download | mrust-e73e8d843b57933e041ffff784d46d8db80a84c6.tar.gz |
Parse/expr - Allow flow control in struct literals
Diffstat (limited to 'src')
-rw-r--r-- | src/parse/expr.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/parse/expr.cpp b/src/parse/expr.cpp index 20a7193e..8bcde31e 100644 --- a/src/parse/expr.cpp +++ b/src/parse/expr.cpp @@ -865,8 +865,9 @@ ExprNodeP Parse_ExprVal_StructLiteral(TokenStream& lex, AST::Path path) {
::std::string name = tok.str();
GET_CHECK_TOK(tok, lex, TOK_COLON);
- ExprNodeP val = Parse_Expr0(lex);
+ ExprNodeP val = Parse_Stmt(lex);
items.push_back( ::std::make_pair(::std::move(name), ::std::move(val)) );
+
if( GET_TOK(tok,lex) == TOK_BRACE_CLOSE )
break;
CHECK_TOK(tok, TOK_COMMA);
|