Commit 82c357f1 authored by POTTIER Francois's avatar POTTIER Francois

Define [import] and [export] more efficiently.

parent 8fa73bee
......@@ -3,18 +3,18 @@ open Expr12 (* [oexpr] *)
open Expr13 (* [expr] *)
open Expr08 (* [hexpr] *)
let import (e : expr) : hexpr =
let import : expr -> hexpr =
let v = object (self)
inherit [_] omap
method visit_'expr _env (E e) =
h (self#visit_oexpr _env e)
end in
v # visit_'expr () e
v # visit_'expr ()
let export (e : hexpr) : expr =
let export : hexpr -> expr =
let v = object (self)
inherit [_] omap
method visit_'expr _env (H { node = e; _ }) =
E (self#visit_oexpr _env e)
end in
v # visit_'expr () e
v # visit_'expr ()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment