diff options
Diffstat (limited to 'frontend')
-rw-r--r-- | frontend/ast_printer.ml | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/frontend/ast_printer.ml b/frontend/ast_printer.ml index b6dcdbc..641e4fd 100644 --- a/frontend/ast_printer.ml +++ b/frontend/ast_printer.ml @@ -52,8 +52,8 @@ let binary_rel_precedence = function | AST_EQ | AST_NE -> 41 | AST_LT | AST_LE | AST_GT | AST_GE -> 40 let binary_bool_precedence = function - | AST_AND -> 31 - | AST_OR -> 30 + | AST_OR -> 31 + | AST_AND -> 30 let arrow_precedence = 20 let if_precedence = 10 @@ -127,7 +127,7 @@ let rec print_expr fmt e = then Format.fprintf fmt " (%a)" print_expr e2 else Format.fprintf fmt " %a" print_expr e2 | AST_binary_bool (op,(e1,_),(e2,_)) -> - if expr_precedence e1 < expr_precedence e + if expr_precedence e1 <= expr_precedence e then Format.fprintf fmt "(%a) " print_expr e1 else Format.fprintf fmt "%a " print_expr e1; Format.pp_print_string fmt (string_of_binary_bool op); |