Skip to content

Commit

Permalink
Remove unused expr node in AST
Browse files Browse the repository at this point in the history
  • Loading branch information
tjammer committed Sep 12, 2024
1 parent 0aa32f2 commit 441fc83
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 12 deletions.
1 change: 0 additions & 1 deletion lib/ast.ml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ and expr =
| Bop of loc * bop * expr * expr
| Unop of loc * ident * expr
| If of loc * expr * expr * expr option
| Let_e of loc * decl * passed_expr * expr
| Lambda of
loc * decl list * func_attr list * (type_spec * loc) option * block
| App of loc * expr * argument list
Expand Down
11 changes: 0 additions & 11 deletions lib/typing/typing.ml
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,6 @@ end = struct
let attr = { no_attr with const = true } in
{ typ = tunit; expr = Const Unit; attr; loc }
| Lambda (loc, id, attr, ret, e) -> convert_lambda env loc id attr ret e
| Let_e (loc, decl, expr, cont) -> convert_let_e env loc decl expr cont
| App (loc, e1, e2) -> convert_app ~switch_uni:false env loc e1 e2
| Bop (loc, bop, e1, e2) -> convert_bop env loc bop e1 e2
| Unop (loc, unop, expr) -> convert_unop env loc unop expr
Expand Down Expand Up @@ -703,16 +702,6 @@ end = struct
let expr = { e1 with attr = { global; const; mut } } in
(env, id, idloc, expr, e1.attr.mut, pat_exprs)

and convert_let_e env loc decl expr cont =
let env, id, id_loc, rhs, rmut, pats =
convert_let ~global:false env loc decl expr
in
let cont = convert env cont in
let cont = List.fold_left fold_decl cont pats in
let uniq = if rhs.attr.const then uniq_name id else None in
let expr = Let { id; id_loc; uniq; rmut; pass = expr.pattr; rhs; cont } in
{ typ = cont.typ; expr; attr = cont.attr; loc }

and convert_lambda env loc params attr ret_annot body =
let env = Env.open_function env in
enter_level ();
Expand Down

0 comments on commit 441fc83

Please sign in to comment.