File tree 2 files changed +38
-1
lines changed
2 files changed +38
-1
lines changed Original file line number Diff line number Diff line change 1
1
---
2
- refs/heads/master: 7364a8c2b04c0d1ea9079a07348fe693bce90e0c
2
+ refs/heads/master: 906f1fc425a827d7bbbb87a6e86ce0aa7faf0bb8
Original file line number Diff line number Diff line change
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 ] }
You can’t perform that action at this time.
0 commit comments