@@ -331,7 +331,7 @@ let regval_base_convs typ =
331331
332332let add_regval_conv ctx env id typ defs =
333333 let typ_str = Document. to_string (doc_typ typ) in
334- let v_exp = mk_exp (E_id (mk_id " v" )) in
334+ let v_exp = mk_exp (E_id (mk_id " v# " )) in
335335 let base_typ = regval_base_typ env typ in
336336 (* Create a function that converts from regval to the target type. *)
337337 let from_name, to_name = regval_base_convs typ in
@@ -343,13 +343,13 @@ let add_regval_conv ctx env id typ defs =
343343 | Some id ->
344344 let base_exp = mk_exp (E_app (mk_id from_base, [v_exp])) in
345345 let result_exp = Bitfield. construct_bitfield_struct id v_exp in
346- let some_clause = " Some(v) => Some(" ^ string_of_exp result_exp ^ " )" in
346+ let some_clause = " Some(v# ) => Some(" ^ string_of_exp result_exp ^ " )" in
347347 let clauses = " { " ^ some_clause ^ " , None() => None() }" in
348- " function " ^ from_name ^ " v = match " ^ string_of_exp base_exp ^ clauses
348+ " function " ^ from_name ^ " v# = match " ^ string_of_exp base_exp ^ clauses
349349 | _ ->
350350 String. concat " \n "
351351 [
352- Printf. sprintf " function %s Regval_%s(v) = Some(v)" from_name constr_name;
352+ Printf. sprintf " function %s Regval_%s(v# ) = Some(v# )" from_name constr_name;
353353 Printf. sprintf " and %s _ = None()" from_name;
354354 ]
355355 in
@@ -360,7 +360,7 @@ let add_regval_conv ctx env id typ defs =
360360 if is_bitfield_typ env typ then mk_exp (E_app (mk_id to_base, [Bitfield. get_bits_field v_exp]))
361361 else mk_exp (E_app (mk_id (" Regval_" ^ constr_name), [v_exp]))
362362 in
363- let to_function = Printf. sprintf " function %s v = %s" to_name (string_of_exp to_exp) in
363+ let to_function = Printf. sprintf " function %s v# = %s" to_name (string_of_exp to_exp) in
364364 let to_defs = if is_defined defs to_name then [] else [to_val; to_function] in
365365 let cdefs = List. concat (List. map (fun s -> fst (defs_of_string __POS__ ctx s)) (from_defs @ to_defs)) in
366366 defs @ cdefs
0 commit comments