|
@@ -384,24 +384,20 @@ let rec rename_vars rc scope =
|
|
Rename local variables in `e` expression if needed.
|
|
Rename local variables in `e` expression if needed.
|
|
*)
|
|
*)
|
|
let run cl_path ri e =
|
|
let run cl_path ri e =
|
|
- (try
|
|
|
|
- let rc = {
|
|
|
|
- rc_scope = ri.ri_scope;
|
|
|
|
- rc_hoisting = ri.ri_hoisting;
|
|
|
|
- rc_no_shadowing = ri.ri_no_shadowing;
|
|
|
|
- rc_no_catch_var_shadowing = ri.ri_no_catch_var_shadowing;
|
|
|
|
- rc_switch_cases_no_blocks = ri.ri_switch_cases_no_blocks;
|
|
|
|
- rc_reserved = ri.ri_reserved;
|
|
|
|
- rc_var_origins = Hashtbl.create 0;
|
|
|
|
- } in
|
|
|
|
- if ri.ri_reserve_current_top_level_symbol then begin
|
|
|
|
- match cl_path with
|
|
|
|
- | s :: _,_ | [],s -> reserve_ctx rc s
|
|
|
|
- end;
|
|
|
|
- let scope = create_scope None in
|
|
|
|
- collect_vars rc scope e;
|
|
|
|
- rename_vars rc scope;
|
|
|
|
- with Failure msg ->
|
|
|
|
- die ~p:e.epos msg __LOC__
|
|
|
|
- );
|
|
|
|
- e
|
|
|
|
|
|
+ let rc = {
|
|
|
|
+ rc_scope = ri.ri_scope;
|
|
|
|
+ rc_hoisting = ri.ri_hoisting;
|
|
|
|
+ rc_no_shadowing = ri.ri_no_shadowing;
|
|
|
|
+ rc_no_catch_var_shadowing = ri.ri_no_catch_var_shadowing;
|
|
|
|
+ rc_switch_cases_no_blocks = ri.ri_switch_cases_no_blocks;
|
|
|
|
+ rc_reserved = ri.ri_reserved;
|
|
|
|
+ rc_var_origins = Hashtbl.create 0;
|
|
|
|
+ } in
|
|
|
|
+ if ri.ri_reserve_current_top_level_symbol then begin
|
|
|
|
+ match cl_path with
|
|
|
|
+ | s :: _,_ | [],s -> reserve_ctx rc s
|
|
|
|
+ end;
|
|
|
|
+ let scope = create_scope None in
|
|
|
|
+ collect_vars rc scope e;
|
|
|
|
+ rename_vars rc scope;
|
|
|
|
+ e
|