Switched to the new GT

This commit is contained in:
Dmitry Boulytchev 2018-05-28 18:44:38 +03:00
parent 72c963f60f
commit 1ac302ac46
2 changed files with 8 additions and 7 deletions

View file

@ -285,8 +285,8 @@ module Stmt =
| x:IDENT {Ident x} | x:IDENT {Ident x}
) )
let vars p = let vars p = fix0 (fun f ->
transform(t) (object inherit [string list] @t[foldl] method c_Ident s _ name = name::s end) [] p transform(t) (object inherit [string list, _] @t[foldl] f method c_Ident s name = name::s end)) [] p
end end

View file

@ -153,12 +153,13 @@ let compile (defs, p) =
env, true, tag @ List.flatten (List.rev code) @ [DROP] env, true, tag @ List.flatten (List.rev code) @ [DROP]
and bindings p = and bindings p =
let bindings = let bindings =
fix0 (fun fself ->
transform(Stmt.Pattern.t) transform(Stmt.Pattern.t)
(object inherit [int list, (string * int list) list] @Stmt.Pattern.t (object inherit [int list, (string * int list) list, _] @Stmt.Pattern.t
method c_Wildcard path _ = [] method c_Wildcard path = []
method c_Ident path _ s = [s, path] method c_Ident path s = [s, path]
method c_Sexp path x _ ps = List.concat @@ List.mapi (fun i p -> x.GT.f (path @ [i]) p) ps method c_Sexp path x ps = List.concat @@ List.mapi (fun i p -> fself (path @ [i]) p) ps
end) end))
[] []
p p
in in