Skip to content

Commit aa18fe3

Browse files
committed
---
yaml --- r: 5205 b: refs/heads/master c: 3667137 h: refs/heads/master i: 5203: 723d649 v: v3
1 parent b2b35b7 commit aa18fe3

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: fc6b7c8b381bcb506eab0f50c69b6cc18aafacb2
2+
refs/heads/master: 3667137a4104ecde5c37f128d6d8c6080529f89f

trunk/src/comp/syntax/parse/parser.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -826,7 +826,8 @@ fn parse_bottom_expr(p: parser) -> @ast::expr {
826826
hi = p.get_hi_pos();
827827
expect(p, token::RBRACE);
828828
ex = ast::expr_rec(fields, base);
829-
} else if p.peek() == token::BINOP(token::OR) {
829+
} else if p.peek() == token::BINOP(token::OR) ||
830+
p.peek() == token::OROR {
830831
ret parse_fn_block_expr(p);
831832
} else {
832833
let blk = parse_block_tail(p, lo, ast::checked);
@@ -1772,10 +1773,13 @@ fn parse_fn_decl(p: parser, purity: ast::purity, il: ast::inlineness) ->
17721773
}
17731774

17741775
fn parse_fn_block_decl(p: parser) -> ast::fn_decl {
1775-
let inputs: ast::spanned<[ast::arg]> =
1776+
let inputs = if p.peek() == token::OROR {
1777+
p.bump(); []
1778+
} else {
17761779
parse_seq(token::BINOP(token::OR), token::BINOP(token::OR),
1777-
some(token::COMMA), parse_fn_block_arg, p);
1778-
ret {inputs: inputs.node,
1780+
some(token::COMMA), parse_fn_block_arg, p).node
1781+
};
1782+
ret {inputs: inputs,
17791783
output: @spanned(p.get_lo_pos(), p.get_hi_pos(), ast::ty_infer),
17801784
purity: ast::impure_fn,
17811785
il: ast::il_normal,

0 commit comments

Comments
 (0)