Delete evaluator.py shim: all imports go directly to bootstrapped sx_ref.py
EvalError moved to types.py. All 27 files updated to import eval_expr, trampoline, call_lambda, etc. directly from shared.sx.ref.sx_ref instead of through the evaluator.py indirection layer. 320/320 spec tests pass. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -314,7 +314,7 @@ def _self_hosting_data(ref_dir: str) -> dict:
|
||||
import os
|
||||
from shared.sx.parser import parse_all
|
||||
from shared.sx.types import Symbol
|
||||
from shared.sx.evaluator import evaluate, make_env
|
||||
from shared.sx.ref.sx_ref import evaluate, make_env
|
||||
from shared.sx.ref.bootstrap_py import extract_defines, compile_ref_to_py, PyEmitter
|
||||
|
||||
try:
|
||||
@@ -387,7 +387,7 @@ def _js_self_hosting_data(ref_dir: str) -> dict:
|
||||
"""Run js.sx live: load into evaluator, translate all spec defines."""
|
||||
import os
|
||||
from shared.sx.types import Symbol
|
||||
from shared.sx.evaluator import evaluate
|
||||
from shared.sx.ref.sx_ref import evaluate
|
||||
from shared.sx.ref.run_js_sx import load_js_sx
|
||||
from shared.sx.ref.platform_js import extract_defines
|
||||
|
||||
@@ -661,7 +661,7 @@ def _run_spec_tests() -> dict:
|
||||
import os
|
||||
import time
|
||||
from shared.sx.parser import parse_all
|
||||
from shared.sx.evaluator import _eval, _trampoline
|
||||
from shared.sx.ref.sx_ref import eval_expr as _eval, trampoline as _trampoline
|
||||
|
||||
ref_dir = os.path.join(os.path.dirname(__file__), "..", "..", "shared", "sx", "ref")
|
||||
if not os.path.isdir(ref_dir):
|
||||
@@ -735,7 +735,7 @@ def _run_modular_tests(spec_name: str) -> dict:
|
||||
import os
|
||||
import time
|
||||
from shared.sx.parser import parse_all
|
||||
from shared.sx.evaluator import _eval, _trampoline
|
||||
from shared.sx.ref.sx_ref import eval_expr as _eval, trampoline as _trampoline
|
||||
from shared.sx.types import Symbol, Keyword, Lambda, NIL
|
||||
|
||||
ref_dir = os.path.join(os.path.dirname(__file__), "..", "..", "shared", "sx", "ref")
|
||||
@@ -817,7 +817,7 @@ def _run_modular_tests(spec_name: str) -> dict:
|
||||
|
||||
def _call_sx(fn, args, caller_env):
|
||||
if isinstance(fn, Lambda):
|
||||
from shared.sx.evaluator import _call_lambda
|
||||
from shared.sx.ref.sx_ref import call_lambda as _call_lambda
|
||||
return _trampoline(_call_lambda(fn, list(args), caller_env))
|
||||
return fn(*args)
|
||||
|
||||
@@ -1165,9 +1165,9 @@ def _prove_data() -> dict:
|
||||
"""
|
||||
import time
|
||||
from shared.sx.parser import parse_all
|
||||
from shared.sx.evaluator import evaluate
|
||||
from shared.sx.ref.sx_ref import evaluate
|
||||
from shared.sx.primitives import all_primitives
|
||||
from shared.sx.evaluator import _trampoline, _call_lambda
|
||||
from shared.sx.ref.sx_ref import trampoline as _trampoline, call_lambda as _call_lambda
|
||||
|
||||
env = all_primitives()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user