summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn Hodge <tpg@mutabah.net>2016-02-26 07:59:46 +0800
committerJohn Hodge <tpg@mutabah.net>2016-02-26 07:59:46 +0800
commite73e8d843b57933e041ffff784d46d8db80a84c6 (patch)
tree4399f213111dbdac3a207d30334dc5598b58447a /src
parentb1b7e4237dee5fdbb280baec3fe7a3b38f6425f7 (diff)
downloadmrust-e73e8d843b57933e041ffff784d46d8db80a84c6.tar.gz
Parse/expr - Allow flow control in struct literals
Diffstat (limited to 'src')
-rw-r--r--src/parse/expr.cpp3
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);