mirror of
https://github.com/ProgramSnail/Lama.git
synced 2025-12-06 06:48:48 +00:00
Switched to the new GT
This commit is contained in:
parent
72c963f60f
commit
1ac302ac46
2 changed files with 8 additions and 7 deletions
|
|
@ -285,8 +285,8 @@ module Stmt =
|
|||
| x:IDENT {Ident x}
|
||||
)
|
||||
|
||||
let vars p =
|
||||
transform(t) (object inherit [string list] @t[foldl] method c_Ident s _ name = name::s end) [] p
|
||||
let vars p = fix0 (fun f ->
|
||||
transform(t) (object inherit [string list, _] @t[foldl] f method c_Ident s name = name::s end)) [] p
|
||||
|
||||
end
|
||||
|
||||
|
|
|
|||
11
src/SM.ml
11
src/SM.ml
|
|
@ -153,12 +153,13 @@ let compile (defs, p) =
|
|||
env, true, tag @ List.flatten (List.rev code) @ [DROP]
|
||||
and bindings p =
|
||||
let bindings =
|
||||
fix0 (fun fself ->
|
||||
transform(Stmt.Pattern.t)
|
||||
(object inherit [int list, (string * int list) list] @Stmt.Pattern.t
|
||||
method c_Wildcard 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
|
||||
end)
|
||||
(object inherit [int list, (string * int list) list, _] @Stmt.Pattern.t
|
||||
method c_Wildcard path = []
|
||||
method c_Ident path s = [s, path]
|
||||
method c_Sexp path x ps = List.concat @@ List.mapi (fun i p -> fself (path @ [i]) p) ps
|
||||
end))
|
||||
[]
|
||||
p
|
||||
in
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue