Two bugs fixed:
1. process-bindings used merge(env) which returns {} for Env objects
(Env is not a dict subclass). Changed to env-extend in render.sx
and adapter-async.sx. This caused "Undefined symbol: theme" etc.
2. async-aser-eval-call passed evaled-args list to async-invoke(&rest),
double-wrapping it. Changed to inline apply + coroutine check.
Also: bootstrap define-async into sx_ref.py (Phase 6), replace ~1000 LOC
hand-written async_eval_ref.py with 24-line thin re-export shim.
Test runner now uses Env (not flat dict) for render envs to catch scope bugs.
8 new regression tests (4 scope chain, 2 native callable arity, 2 render).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
23 lines
868 B
Python
23 lines
868 B
Python
"""Async evaluation — thin re-export from bootstrapped sx_ref.py.
|
|
|
|
The async adapter (adapter-async.sx) is now bootstrapped directly into
|
|
sx_ref.py alongside the sync evaluator. This file re-exports the public
|
|
API so existing imports keep working.
|
|
|
|
All async rendering, serialization, and evaluation logic lives in the spec:
|
|
- shared/sx/ref/adapter-async.sx (canonical SX source)
|
|
- shared/sx/ref/sx_ref.py (bootstrapped Python)
|
|
|
|
Platform async primitives (I/O dispatch, context vars, RequestContext)
|
|
are in shared/sx/ref/platform_py.py → PLATFORM_ASYNC_PY.
|
|
"""
|
|
|
|
from . import sx_ref
|
|
|
|
# Re-export the public API used by handlers.py, helpers.py, pages.py, etc.
|
|
EvalError = sx_ref.EvalError
|
|
async_eval = sx_ref.async_eval
|
|
async_render = sx_ref.async_render
|
|
async_eval_to_sx = sx_ref.async_eval_to_sx
|
|
async_eval_slot_to_sx = sx_ref.async_eval_slot_to_sx
|