File tree 3 files changed +32
-2
lines changed
3 files changed +32
-2
lines changed Original file line number Diff line number Diff line change @@ -60,8 +60,20 @@ comparison: bitw_or (comp_op bitw_or)*
60
60
comp_op : " >" | " <" | " ==" | " !=" | " <=" | " >="
61
61
bitw_or : bitw_xor (" |" bitw_xor )*
62
62
bitw_xor : bitw_and (" ^" bitw_and )*
63
- bitw_and : atom (" &" atom )*
64
- atom : NAME | literal
63
+ bitw_and : shift_expr (" &" shift_expr )*
64
+ shift_expr : subtr_expr ((" <<" | " >>" ) subtr_expr )*
65
+ subtr_expr : addn_expr (" -" addn_expr )*
66
+ addn_expr : mdr_expr (" +" mdr_expr )*
67
+ mdr_expr : neg_expr ((" *" | " /" | " %" ) neg_expr )*
68
+ neg_expr : " -" neg_expr | bitw_not
69
+ bitw_not : " ~" bitw_not | type_test
70
+ type_test : attr_expr (" is" atom )*
71
+ attr_expr : subscr_expr (" ." NAME )*
72
+ subscr_expr : call_expr [" [" atom " ]" ] // TODO: expr inside []
73
+ call_expr : atom [" (" " )" ] // TODO: expr(s,) inside ()
74
+ atom : " (" expr " )"
75
+ | NAME
76
+ | literal
65
77
literal : NUMBER
66
78
67
79
TYPE : NAME
Original file line number Diff line number Diff line change
1
+ all :
2
+ pytest -v
Original file line number Diff line number Diff line change
1
+ func bar ():
2
+ pass
1
3
func foo ():
2
4
var x
3
5
1 if true else 2
@@ -17,3 +19,17 @@ func foo():
17
19
3 | 3
18
20
6 ^ 5
19
21
8 & 7
22
+ 5 >> 7
23
+ 7 << 5
24
+ 5 - 6
25
+ 6 + 7
26
+ 7 * 7
27
+ 7 / 8
28
+ 6 % 3
29
+ - 8
30
+ ~ 8
31
+ x is int
32
+ x .attr
33
+ x [10 ]
34
+ bar ()
35
+ (2 + 2 )
You can’t perform that action at this time.
0 commit comments