Commit 7d004cb2 authored by POTTIER Francois's avatar POTTIER Francois

New tests.

parent 2b7b9058
type 'expr expr_node =
type 'info expr_node =
| EConst of int
| EAdd of 'expr * 'expr
| EAdd of 'info expr * 'info expr
and 'info expr =
{ info: 'info; node: 'info expr_node }
[@@deriving visitors { name = "map"; variety = "map" }]
open Expr09
let strip (e : _ expr) : unit expr =
let v = object
inherit [_] map
method visit_'info _env _info = ()
end in
v # visit_expr () e
let number (e : _ expr) : int expr =
let v = object
inherit [_] map
val mutable count = 0
method visit_'info _env _info =
let c = count in count <- c + 1; c
end in
v # visit_expr () e
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