rm debug print
This commit is contained in:
8
sexpr.ml
8
sexpr.ml
@@ -686,11 +686,6 @@ module SExprMacroExp = struct
|
||||
|
||||
let rec eval (ctx: (string * (SExpr.t * SExpr.t)) list) s =
|
||||
let open SExpr in
|
||||
Format.printf "ctx:\n%!";
|
||||
List.iter begin fun vv ->
|
||||
let k,v = vv in
|
||||
Format.printf "- %s = %a%a\n%!" k pp_t (fst v) pp_t (snd v)
|
||||
end ctx;
|
||||
let s, ctx = if is_list s then
|
||||
aggr_flat_map eval ctx s
|
||||
else
|
||||
@@ -701,21 +696,18 @@ module SExprMacroExp = struct
|
||||
(* expr -> list(new exprs) * bool:changed * ctx *)
|
||||
and check_expands ctx s =
|
||||
let open SExpr in
|
||||
Format.printf "checking: %a\n%!" pp_t s;
|
||||
match s with
|
||||
Cons(Id(":macro"), r) -> begin
|
||||
let a = match r with
|
||||
Cons(Id(l), Cons(a,b)) -> l, (a,b)
|
||||
| _ -> raise @@ Misformated_Macro s
|
||||
in
|
||||
Format.printf "define: %s%a -> %a\n%!" (fst a) pp_t (fst (snd a)) pp_t (snd (snd a));
|
||||
Nil, false, (a :: ctx)
|
||||
end
|
||||
| Cons(Id(i), r) -> begin
|
||||
let i = if String.starts_with ~prefix:":" i then
|
||||
String.sub i 1 ((String.length i) - 1)
|
||||
else "@" in
|
||||
Format.printf "consider expand %s%a\n%!" i pp_t r;
|
||||
let rec test opt ctx =
|
||||
begin match opt with
|
||||
[] -> li1 s, false, ctx
|
||||
|
Reference in New Issue
Block a user