diff options
| author | Marijn Haverbeke <marijnh@gmail.com> | 2011-09-15 17:37:10 +0200 |
|---|---|---|
| committer | Marijn Haverbeke <marijnh@gmail.com> | 2011-09-15 17:37:10 +0200 |
| commit | 7364a8c2b04c0d1ea9079a07348fe693bce90e0c (patch) | |
| tree | 9157cb5840c67c6552e91c0e0955ad764d2b3911 /src/comp/syntax/parse | |
| parent | 93ba85a0f1006e8af6b0ab155fc2cd7ec39eab0c (diff) | |
| download | rust-7364a8c2b04c0d1ea9079a07348fe693bce90e0c.tar.gz rust-7364a8c2b04c0d1ea9079a07348fe693bce90e0c.zip | |
Prevent binary expressions from parsing when lhs is non-value block
Diffstat (limited to 'src/comp/syntax/parse')
| -rw-r--r-- | src/comp/syntax/parse/parser.rs | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/comp/syntax/parse/parser.rs b/src/comp/syntax/parse/parser.rs index b2da68b0cd9..5e66ba88126 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 { |
