rm tokenizer/parser/mcode generators from C

This commit is contained in:
2026-02-09 20:05:50 -06:00
parent 27e852af5b
commit 3e42c57479
16 changed files with 198175 additions and 5998 deletions

View File

@@ -13,7 +13,7 @@ use_cache['fd'] = fd
use_cache['os'] = os
use_cache['json'] = json
// Bootstrap: load tokenize.cm and parse.cm via C pipeline (mach_eval)
// Bootstrap: load tokenize.cm and parse.cm from pre-compiled AST JSON
function use_basic(path) {
if (use_cache[path])
return use_cache[path]
@@ -22,17 +22,16 @@ function use_basic(path) {
return result
}
var tok_path = core_path + "/tokenize.cm"
var par_path = core_path + "/parse.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 tok_ast_path = core_path + "/tokenize.ast.json"
var par_ast_path = core_path + "/parse.ast.json"
var tokenize_mod = mach_eval_ast("tokenize", text(fd.slurp(tok_ast_path)), {use: use_basic})
var parse_mod = mach_eval_ast("parse", text(fd.slurp(par_ast_path)), {use: use_basic})
// Optionally load mcode compiler module
var mcode_mod = null
var mcode_path = null
var mcode_ast_path = core_path + "/mcode.ast.json"
if (use_mcode) {
mcode_path = core_path + "/mcode.cm"
mcode_mod = mach_eval("mcode", text(fd.slurp(mcode_path)), {use: use_basic})
mcode_mod = mach_eval_ast("mcode", text(fd.slurp(mcode_ast_path)), {use: use_basic})
}
// analyze: tokenize + parse, check for errors