Skip to content

Commit 558085d

Browse files
committed
---
yaml --- r: 5317 b: refs/heads/master c: 906f1fc h: refs/heads/master i: 5315: 5e42817 v: v3
1 parent e7c5392 commit 558085d

File tree

2 files changed

+38
-1
lines changed

2 files changed

+38
-1
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: 7364a8c2b04c0d1ea9079a07348fe693bce90e0c
2+
refs/heads/master: 906f1fc425a827d7bbbb87a6e86ce0aa7faf0bb8
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
// A bunch of tests for syntactic forms involving blocks that were
2+
// previously ambiguous (e.g. 'if true { } *val;' gets parsed as a
3+
// binop)
4+
5+
fn test1() { let val = @0; { } *val; }
6+
7+
fn test2() -> int { let val = @0; { } *val }
8+
9+
fn test3() {
10+
let regs = @{mutable eax: 0};
11+
alt true { true { } }
12+
(*regs).eax = 1;
13+
}
14+
15+
fn test4() -> bool { let regs = @true; if true { } *regs || false }
16+
17+
fn test5() -> (int, int) { { } (0, 1) }
18+
19+
fn test6() -> bool { { } (true || false) && true }
20+
21+
fn test7() -> uint {
22+
let regs = @0;
23+
alt true { true { } }
24+
(*regs < 2) as uint
25+
}
26+
27+
fn test8() -> int { let val = @0; alt true { true { } } *val < 1 ? 0 : 1 }
28+
29+
fn test9() { let regs = @mutable 0; alt true { true { } } *regs += 1; }
30+
31+
fn test10() -> int {
32+
let regs = @mutable [0];
33+
alt true { true { } }
34+
(*regs)[0]
35+
}
36+
37+
fn test11() -> [int] { if true { } [1, 2] }

0 commit comments

Comments
 (0)