From 4d4fa99b314c78ff50f744beace5f2b62b211df1 Mon Sep 17 00:00:00 2001 From: Graydon Hoare Date: Fri, 23 Jul 2010 11:37:38 -0700 Subject: Rename STMT_init_* to STMT_new_*; former name was confusing. --- src/boot/fe/ast.ml | 28 ++++++++++++++-------------- src/boot/fe/pexp.ml | 20 ++++++++++---------- 2 files changed, 24 insertions(+), 24 deletions(-) (limited to 'src/boot/fe') diff --git a/src/boot/fe/ast.ml b/src/boot/fe/ast.ml index 390d944d..511ca33c 100644 --- a/src/boot/fe/ast.ml +++ b/src/boot/fe/ast.ml @@ -200,13 +200,13 @@ and stmt' = (* lval-assigning stmts. *) STMT_spawn of (lval * domain * lval * (atom array)) - | STMT_init_rec of (lval * (rec_input array) * lval option) - | STMT_init_tup of (lval * (tup_input array)) - | STMT_init_vec of (lval * mutability * atom array) - | STMT_init_str of (lval * string) - | STMT_init_port of lval - | STMT_init_chan of (lval * (lval option)) - | STMT_init_box of (lval * mutability * atom) + | STMT_new_rec of (lval * (rec_input array) * lval option) + | STMT_new_tup of (lval * (tup_input array)) + | STMT_new_vec of (lval * mutability * atom array) + | STMT_new_str of (lval * string) + | STMT_new_port of lval + | STMT_new_chan of (lval * (lval option)) + | STMT_new_box of (lval * mutability * atom) | STMT_copy of (lval * expr) | STMT_copy_binop of (lval * binop * atom) | STMT_call of (lval * lval * (atom array)) @@ -1028,7 +1028,7 @@ and fmt_stmt_body (ff:Format.formatter) (s:stmt) : unit = | STMT_decl (DECL_mod_item (ident, item)) -> fmt_mod_item ff ident item - | STMT_init_rec (dst, entries, base) -> + | STMT_new_rec (dst, entries, base) -> fmt_lval ff dst; fmt ff " = rec("; for i = 0 to (Array.length entries) - 1 @@ -1050,7 +1050,7 @@ and fmt_stmt_body (ff:Format.formatter) (s:stmt) : unit = end; fmt ff ");" - | STMT_init_vec (dst, mutability, atoms) -> + | STMT_new_vec (dst, mutability, atoms) -> fmt_lval ff dst; fmt ff " = vec"; if mutability = MUT_mutable then fmt ff "[mutable]"; @@ -1063,7 +1063,7 @@ and fmt_stmt_body (ff:Format.formatter) (s:stmt) : unit = done; fmt ff ");" - | STMT_init_tup (dst, entries) -> + | STMT_new_tup (dst, entries) -> fmt_lval ff dst; fmt ff " = tup("; for i = 0 to (Array.length entries) - 1 @@ -1076,15 +1076,15 @@ and fmt_stmt_body (ff:Format.formatter) (s:stmt) : unit = done; fmt ff ");"; - | STMT_init_str (dst, s) -> + | STMT_new_str (dst, s) -> fmt_lval ff dst; fmt ff " = \"%s\"" (String.escaped s) - | STMT_init_port dst -> + | STMT_new_port dst -> fmt_lval ff dst; fmt ff " = port();" - | STMT_init_chan (dst, port_opt) -> + | STMT_new_chan (dst, port_opt) -> fmt_lval ff dst; fmt ff " = chan("; begin @@ -1188,7 +1188,7 @@ and fmt_stmt_body (ff:Format.formatter) (s:stmt) : unit = fmt_lval ff t; fmt ff ";" - | STMT_init_box (lv, mutability, at) -> + | STMT_new_box (lv, mutability, at) -> fmt_lval ff lv; fmt ff " = @@"; if mutability = MUT_mutable then fmt ff " mutable "; diff --git a/src/boot/fe/pexp.ml b/src/boot/fe/pexp.ml index f828cc5f..72fa9d7e 100644 --- a/src/boot/fe/pexp.ml +++ b/src/boot/fe/pexp.ml @@ -1008,7 +1008,7 @@ let expand_pexp_custom ignore (Unix.close_process_in c); Buffer.contents b in - [| spanner (Ast.STMT_init_str (dst_lval, r())) |] + [| spanner (Ast.STMT_new_str (dst_lval, r())) |] | _ -> raise (err ("unknown syntax extension: " ^ nstr) ps) @@ -1018,7 +1018,7 @@ let expand_pexp_custom * Desugarings depend on context: * * - If a pexp is used on the RHS of an assignment, it's turned into - * an initialization statement such as STMT_init_rec or such. This + * an initialization statement such as STMT_new_rec or such. This * removes the possibility of initializing into a temp only to * copy out. If the topmost pexp in such a desugaring is an atom, * unop or binop, of course, it will still just emit a STMT_copy @@ -1265,13 +1265,13 @@ and desugar_expr_init Some base -> let (base_stmts, base_lval) = desugar_lval ps base in let rec_stmt = - ss (Ast.STMT_init_rec + ss (Ast.STMT_new_rec (dst_lval, entries, Some base_lval)) in ac [ arg_stmts; base_stmts; [| rec_stmt |] ] | None -> let rec_stmt = - ss (Ast.STMT_init_rec (dst_lval, entries, None)) + ss (Ast.STMT_new_rec (dst_lval, entries, None)) in aa arg_stmts [| rec_stmt |] end @@ -1283,22 +1283,22 @@ and desugar_expr_init in let arg_atoms = Array.to_list arg_atoms in let tup_args = Array.of_list (List.combine muts arg_atoms) in - let stmt = ss (Ast.STMT_init_tup (dst_lval, tup_args)) in + let stmt = ss (Ast.STMT_new_tup (dst_lval, tup_args)) in aa arg_stmts [| stmt |] | PEXP_str s -> - let stmt = ss (Ast.STMT_init_str (dst_lval, s)) in + let stmt = ss (Ast.STMT_new_str (dst_lval, s)) in [| stmt |] | PEXP_vec (mutability, args) -> let (arg_stmts, arg_atoms) = desugar_expr_atoms ps args in let stmt = - ss (Ast.STMT_init_vec (dst_lval, mutability, arg_atoms)) + ss (Ast.STMT_new_vec (dst_lval, mutability, arg_atoms)) in aa arg_stmts [| stmt |] | PEXP_port -> - [| ss (Ast.STMT_init_port dst_lval) |] + [| ss (Ast.STMT_new_port dst_lval) |] | PEXP_chan pexp_opt -> let (port_stmts, port_opt) = @@ -1315,7 +1315,7 @@ and desugar_expr_init in let chan_stmt = ss - (Ast.STMT_init_chan (dst_lval, port_opt)) + (Ast.STMT_new_chan (dst_lval, port_opt)) in aa port_stmts [| chan_stmt |] @@ -1324,7 +1324,7 @@ and desugar_expr_init desugar_expr_atom ps arg in let stmt = - ss (Ast.STMT_init_box (dst_lval, mutability, arg_mode_atom)) + ss (Ast.STMT_new_box (dst_lval, mutability, arg_mode_atom)) in aa arg_stmts [| stmt |] -- cgit v1.2.3