From 7364a8c2b04c0d1ea9079a07348fe693bce90e0c Mon Sep 17 00:00:00 2001 From: Marijn Haverbeke Date: Thu, 15 Sep 2011 17:37:10 +0200 Subject: [PATCH] Prevent binary expressions from parsing when lhs is non-value block --- src/comp/syntax/parse/parser.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/comp/syntax/parse/parser.rs b/src/comp/syntax/parse/parser.rs index b2da68b0cd95..5e66ba881263 100644 --- a/src/comp/syntax/parse/parser.rs +++ b/src/comp/syntax/parse/parser.rs @@ -1188,6 +1188,7 @@ const ternary_prec: int = 0; fn parse_more_binops(p: parser, lhs: @ast::expr, min_prec: int) -> @ast::expr { + if !expr_has_value(lhs) { ret lhs; } let peeked = p.peek(); for cur: op_spec in *p.get_prec_table() { if cur.prec > min_prec && cur.tok == peeked {