expr_info_use.ml 369 Bytes
Newer Older
1
open Expr_info
POTTIER Francois's avatar
POTTIER Francois committed
2

3
let strip (e : _ expr) : unit expr =
POTTIER Francois's avatar
POTTIER Francois committed
4 5 6 7
  let v = object
    inherit [_] map
    method visit_'info _env _info = ()
  end in
8
  v # visit_expr () e
POTTIER Francois's avatar
POTTIER Francois committed
9 10 11 12 13 14 15 16 17

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