Skip to content
Snippets Groups Projects
Commit 0d35c29c authored by Erwan Jahier's avatar Erwan Jahier
Browse files

Fixing ec the backend (cont'): fix a parenthesis issue around tuples.

parent 4ee68d20
No related branches found
No related tags found
No related merge requests found
(** Time-stamp: <modified the 25/02/2009 (at 14:12) by Erwan Jahier> *)
(** Time-stamp: <modified the 25/02/2009 (at 15:01) by Erwan Jahier> *)
open Printf
open Lxm
......@@ -27,8 +27,10 @@ let (get_rank : 'a -> 'a list -> int) =
let _ = assert (get_rank 5 [1;3;5] = 3)
let (is_a_tuple : Eff.val_exp -> bool) =
(* check it is a non-singleton tuple *)
let rec (is_a_tuple : Eff.val_exp -> bool) =
function
| CallByPosEff ({ it = TUPLE }, OperEff [ve]) -> is_a_tuple ve
| CallByPosEff ({ it = TUPLE }, OperEff vel) -> List.length vel > 1
| _ -> false
......@@ -305,8 +307,8 @@ and (string_of_by_pos_op_eff: Eff.by_pos_op srcflagged -> Eff.val_exp list -> st
match op with
| Predef.ICONST_n _ | Predef.RCONST_n _ | Predef.NOT_n
| Predef.UMINUS_n | Predef.IUMINUS_n | Predef.RUMINUS_n
| Predef.FALSE_n | Predef.TRUE_n -> tuple vel
| _ -> tuple_par vel
| Predef.FALSE_n | Predef.TRUE_n -> tuple vel
| _ -> tuple_par vel
else
"<<" ^
(String.concat ", " (List.map (static_arg2string) sargs))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment