Skip to content

Commit 7364a8c

Browse files
committed
Prevent binary expressions from parsing when lhs is non-value block
1 parent 93ba85a commit 7364a8c

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/comp/syntax/parse/parser.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1188,6 +1188,7 @@ const ternary_prec: int = 0;
11881188

11891189
fn parse_more_binops(p: parser, lhs: @ast::expr, min_prec: int) ->
11901190
@ast::expr {
1191+
if !expr_has_value(lhs) { ret lhs; }
11911192
let peeked = p.peek();
11921193
for cur: op_spec in *p.get_prec_table() {
11931194
if cur.prec > min_prec && cur.tok == peeked {

0 commit comments

Comments
 (0)