File tree Expand file tree Collapse file tree 3 files changed +57
-63
lines changed Expand file tree Collapse file tree 3 files changed +57
-63
lines changed Original file line number Diff line number Diff line change @@ -110567,27 +110567,25 @@ type arg_expression =
110567
110567
110568
110568
(* we need destruct [undefined] when input is optional *)
110569
110569
let eval (arg : J.expression) (dispatches : (Ast_compatible.hash_label * string) list option) : E.t =
110570
- if arg == E.undefined then E.undefined else
110571
- match arg.expression_desc with
110572
- | Str (_,s) ->
110573
- let s = match dispatches with
110574
- | None -> s
110575
- | Some dispatches ->
110576
- (Ext_list.assoc_by_string dispatches s None) in
110577
- E.str s
110578
- | _ ->
110579
- match dispatches with
110580
- | None ->
110581
- E.poly_var_tag_access arg
110582
- | Some dispatches ->
110583
- E.of_block
110584
- [(S.string_switch arg
110585
- (Ext_list.map dispatches (fun (i,r) ->
110586
- {J.switch_case = i ;
110587
- switch_body = [S.return_stmt (E.str r)];
110588
- should_break = false; (* FIXME: if true, still print break*)
110589
- comment = None;
110590
- })))]
110570
+ match dispatches with
110571
+ | None -> arg
110572
+ | Some dispatches ->
110573
+ if arg == E.undefined then E.undefined
110574
+ else
110575
+ match arg.expression_desc with
110576
+ | Str (_,s) ->
110577
+ let s =
110578
+ (Ext_list.assoc_by_string dispatches s None) in
110579
+ E.str s
110580
+ | _ ->
110581
+ E.of_block
110582
+ [(S.string_switch arg
110583
+ (Ext_list.map dispatches (fun (i,r) ->
110584
+ {J.switch_case = i ;
110585
+ switch_body = [S.return_stmt (E.str r)];
110586
+ should_break = false; (* FIXME: if true, still print break*)
110587
+ comment = None;
110588
+ })))]
110591
110589
110592
110590
(** invariant: optional is not allowed in this case *)
110593
110591
(** arg is a polyvar *)
Original file line number Diff line number Diff line change @@ -110567,27 +110567,25 @@ type arg_expression =
110567
110567
110568
110568
(* we need destruct [undefined] when input is optional *)
110569
110569
let eval (arg : J.expression) (dispatches : (Ast_compatible.hash_label * string) list option) : E.t =
110570
- if arg == E.undefined then E.undefined else
110571
- match arg.expression_desc with
110572
- | Str (_,s) ->
110573
- let s = match dispatches with
110574
- | None -> s
110575
- | Some dispatches ->
110576
- (Ext_list.assoc_by_string dispatches s None) in
110577
- E.str s
110578
- | _ ->
110579
- match dispatches with
110580
- | None ->
110581
- E.poly_var_tag_access arg
110582
- | Some dispatches ->
110583
- E.of_block
110584
- [(S.string_switch arg
110585
- (Ext_list.map dispatches (fun (i,r) ->
110586
- {J.switch_case = i ;
110587
- switch_body = [S.return_stmt (E.str r)];
110588
- should_break = false; (* FIXME: if true, still print break*)
110589
- comment = None;
110590
- })))]
110570
+ match dispatches with
110571
+ | None -> arg
110572
+ | Some dispatches ->
110573
+ if arg == E.undefined then E.undefined
110574
+ else
110575
+ match arg.expression_desc with
110576
+ | Str (_,s) ->
110577
+ let s =
110578
+ (Ext_list.assoc_by_string dispatches s None) in
110579
+ E.str s
110580
+ | _ ->
110581
+ E.of_block
110582
+ [(S.string_switch arg
110583
+ (Ext_list.map dispatches (fun (i,r) ->
110584
+ {J.switch_case = i ;
110585
+ switch_body = [S.return_stmt (E.str r)];
110586
+ should_break = false; (* FIXME: if true, still print break*)
110587
+ comment = None;
110588
+ })))]
110591
110589
110592
110590
(** invariant: optional is not allowed in this case *)
110593
110591
(** arg is a polyvar *)
Original file line number Diff line number Diff line change @@ -392675,27 +392675,25 @@ type arg_expression =
392675
392675
392676
392676
(* we need destruct [undefined] when input is optional *)
392677
392677
let eval (arg : J.expression) (dispatches : (Ast_compatible.hash_label * string) list option) : E.t =
392678
- if arg == E.undefined then E.undefined else
392679
- match arg.expression_desc with
392680
- | Str (_,s) ->
392681
- let s = match dispatches with
392682
- | None -> s
392683
- | Some dispatches ->
392684
- (Ext_list.assoc_by_string dispatches s None) in
392685
- E.str s
392686
- | _ ->
392687
- match dispatches with
392688
- | None ->
392689
- E.poly_var_tag_access arg
392690
- | Some dispatches ->
392691
- E.of_block
392692
- [(S.string_switch arg
392693
- (Ext_list.map dispatches (fun (i,r) ->
392694
- {J.switch_case = i ;
392695
- switch_body = [S.return_stmt (E.str r)];
392696
- should_break = false; (* FIXME: if true, still print break*)
392697
- comment = None;
392698
- })))]
392678
+ match dispatches with
392679
+ | None -> arg
392680
+ | Some dispatches ->
392681
+ if arg == E.undefined then E.undefined
392682
+ else
392683
+ match arg.expression_desc with
392684
+ | Str (_,s) ->
392685
+ let s =
392686
+ (Ext_list.assoc_by_string dispatches s None) in
392687
+ E.str s
392688
+ | _ ->
392689
+ E.of_block
392690
+ [(S.string_switch arg
392691
+ (Ext_list.map dispatches (fun (i,r) ->
392692
+ {J.switch_case = i ;
392693
+ switch_body = [S.return_stmt (E.str r)];
392694
+ should_break = false; (* FIXME: if true, still print break*)
392695
+ comment = None;
392696
+ })))]
392699
392697
392700
392698
(** invariant: optional is not allowed in this case *)
392701
392699
(** arg is a polyvar *)
You can’t perform that action at this time.
0 commit comments