This commit is contained in:
2025-08-31 12:14:00 +02:00
parent 3a3f1765ab
commit 71fa80acba
2 changed files with 27 additions and 13 deletions

View File

@@ -830,11 +830,17 @@ module SExprMacroExp = struct
else
s, ctx
end
and eval_root_while ctx s = begin
let s, ch, ctx = eval ctx s in
if ch then
SExpr.aggr_flat_map eval_root_while ctx s
else
s, ctx
end
let do_eval s =
eval_while [] s |> fst
eval_root_while [] s |> fst
(* only use this for testing! *)
let sparse src =
PC.doparse
Format.err_formatter
@@ -925,13 +931,8 @@ let read_all_stdin () =
let () =
let parsr = SExpr.parse_top () in
let src = read_all_stdin () in
let v = PC.doparse
Format.err_formatter
{ source = src; path = "top" }
parsr in
let v = Option.get v in
let v = SExprMacroExp.sparse src in
let v = SExprMacroExp.do_eval v in
Format.set_margin 40;