@@ -53,8 +53,8 @@ fn kind_to_binary_op(kind: Kind) -> Option<(Binary, usize)> {
5353 Plus => Some ( ( Binary :: Plus , 5 ) ) ,
5454 Minus => Some ( ( Binary :: Minus , 5 ) ) ,
5555 Concat => Some ( ( Binary :: Concat , 5 ) ) ,
56- Times => Some ( ( Binary :: Times , 5 ) ) ,
5756
57+ Times => Some ( ( Binary :: Times , 7 ) ) ,
5858 Div => Some ( ( Binary :: Div , 7 ) ) ,
5959 Mod => Some ( ( Binary :: Mod , 7 ) ) ,
6060 Rem => Some ( ( Binary :: Rem , 7 ) ) ,
@@ -1140,6 +1140,13 @@ mod tests {
11401140
11411141 assert_expression_is ( "1-2-3" , "((Integer(1) Minus Integer(2)) Minus Integer(3))" ) ;
11421142
1143+ assert_expression_is ( "1+2*3" , "(Integer(1) Plus (Integer(2) Times Integer(3)))" ) ;
1144+
1145+ assert_expression_is ( "(1+2)*3" , "((Integer(1) Plus Integer(2)) Times Integer(3))" ) ;
1146+
1147+ // Multiplication has precedence over negation.
1148+ assert_expression_is ( "-1 * 2" , "(Minus (Integer(1) Times Integer(2)))" ) ;
1149+
11431150 assert_expression_is ( "not 1 + 2" , "((Not Integer(1)) Plus Integer(2))" ) ;
11441151
11451152 assert_expression_is ( "abs not 1 + 2" , "((Abs (Not Integer(1))) Plus Integer(2))" ) ;
0 commit comments