summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn Hodge <tpg@mutabah.net>2016-02-27 10:26:26 +0800
committerJohn Hodge <tpg@mutabah.net>2016-02-27 10:26:26 +0800
commitd5862368521b8249d997a7def37fed08ff55d8f4 (patch)
tree1748d3c7b9b92ac0a2fd2a20567ff82d08b48b54 /src
parent9f82bacdadaf7e9d2cfe2c5d98daad2d5cd95f62 (diff)
downloadmrust-d5862368521b8249d997a7def37fed08ff55d8f4.tar.gz
Parse/expr - Handle flow control in the middle of an expression
Diffstat (limited to 'src')
-rw-r--r--src/parse/expr.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/parse/expr.cpp b/src/parse/expr.cpp
index 8bcde31e..88e11262 100644
--- a/src/parse/expr.cpp
+++ b/src/parse/expr.cpp
@@ -958,6 +958,13 @@ ExprNodeP Parse_ExprVal(TokenStream& lex)
lex.putback(tok);
return Parse_ExprBlockNode(lex);
+ // TODO: Return/break/continue/... here?
+ case TOK_RWORD_RETURN:
+ case TOK_RWORD_CONTINUE:
+ case TOK_RWORD_BREAK:
+ lex.putback(tok);
+ return Parse_Stmt(lex);
+
case TOK_RWORD_LOOP:
return NEWNODE( AST::ExprNode_Loop, "", Parse_ExprBlockNode(lex) );
case TOK_RWORD_WHILE: