Skip to content

Commit 55d3203

Browse files
committed
[spectec] Remove obsolete translation for optional singleton constructor
1 parent e1eedae commit 55d3203

1 file changed

Lines changed: 0 additions & 13 deletions

File tree

  • spectec/src/backend-prose

spectec/src/backend-prose/gen.ml

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -66,18 +66,6 @@ let extract_rel_hint relid hintid =
6666

6767
let swap = function `LtOp -> `GtOp | `GtOp -> `LtOp | `LeOp -> `GeOp | `GeOp -> `LeOp | op -> op
6868

69-
(* CASE (?(())) ~> CASE
70-
CASE (?()) ~> () *)
71-
let recover_optional_singleton_constructor e =
72-
match e.it with
73-
| Al.Ast.CaseE (Mixop.(Seq [Atom atom; Arg ()]), [{it = OptE opt; _ }]) ->
74-
(
75-
match opt with
76-
| Some _ -> Al.Ast.CaseE (Mixop.Atom atom, [])
77-
| None -> Al.Ast.CaseE (Mixop.Seq [], [])
78-
) |> (fun it -> {e with it})
79-
| _ -> e
80-
8169
(* l ->_ [] r ~> l -> r *)
8270
let remove_empty_arrow_sub e =
8371
match e.it with
@@ -181,7 +169,6 @@ let transpile_expr =
181169
let post_expr =
182170
Il2al.Transpile.simplify_record_concat
183171
>> Il2al.Transpile.reduce_comp
184-
>> recover_optional_singleton_constructor
185172
>> remove_empty_arrow_sub
186173
in
187174
let walk_expr walker expr =

0 commit comments

Comments
 (0)