ast folding

This commit is contained in:
2026-02-09 20:04:40 -06:00
parent 66a44595c8
commit 4b76728230
4 changed files with 1002 additions and 59 deletions

View File

@@ -24,8 +24,10 @@ function use_basic(path) {
var tok_path = core_path + "/tokenize.cm"
var par_path = core_path + "/parse.cm"
var fold_path = core_path + "/fold.cm"
var tokenize_mod = mach_eval("tokenize", text(fd.slurp(tok_path)), {use: use_basic})
var parse_mod = mach_eval("parse", text(fd.slurp(par_path)), {use: use_basic})
var fold_mod = mach_eval("fold", text(fd.slurp(fold_path)), {use: use_basic})
// Optionally load mcode compiler module
var mcode_mod = null
@@ -66,6 +68,7 @@ function analyze(src, filename) {
}
disrupt
}
ast = fold_mod(ast)
return ast
}