https://gitlab.synchro.net/main/sbbs/-/commit/dbd8d7bd3c0dafd5849899d6
Modified Files:
src/syncterm/scripts/connected.wren console.wren src/syncterm/wren_host.c
Log Message:
SyncTERM: load each Wren entry script into its own module
Was: every embedded script (console, connected, runtests) got
loaded into the shared `syncterm` module so it could see the
foreign-class declarations and Wren-side helpers without an
import. That forced a chunk of "load syncterm first, route user
overrides of any embedded script back into the syncterm module"
gymnastics in wren_host_init and load_one_script.
Now: each entry script runs as its own filename-named module and
pulls bindings from `syncterm` via a top-of-file import.
* scripts/console.wren imports Hook, Screen, Console, Input,
Clipboard, Key, REPL, LogSource, MouseEvent
* scripts/connected.wren imports Hook, Conn, BBS, CTerm, ConnType,
Emulation
* scripts/runtests.wren was already importing what it needed.
`host_load_module` becomes the single source of truth for "find a
module's source" Ä search order is user scripts/<name>.wren, then
user scripts/load/<name>.wren, then EMBEDDED_SCRIPTS. The
embedded fallback returns a static pointer with onComplete == NULL
so Wren skips the free. Extracted read_script_file so the
loader and load_one_script share one reader.
is_embedded_script_name and the "route overrides into syncterm"
branch in load_one_script are gone. wren_host_init replaces the
old user-override-vs-embedded-fallback ladder with one bootstrap
line Ä `wrenInterpret(vm, "_bootstrap", "import \"syncterm\" for
Cell, Cells, KeyEvent, MouseEvent\n")` Ä which triggers the
unified lookup and verifies the foreign classes exist before the
C side caches their handles.
Co-Authored-By: Claude Opus 4.7 (1M context) <
noreply@anthropic.com>
---
þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net