std: restructure — std/ modules, namespace tail, std/xml.sx

allocators/fs/process/socket/log/trace/test move under modules/std/
(allocators.sx becomes std/mem.sx; the Allocator protocol moves into
the std.sx prelude, impls stay in mem.sx). New std/xml.sx holds
xml_escape as xml.escape. std.sx gains the carried namespace tail —
flat-importing std.sx now also provides mem./xml./log. — with the
remaining modules (fs/process/socket/json/cli/hash/test) deferred from
the tail until the global last-wins maps are fully own-wins (pulling
them into every closure collides bare names corpus-wide; they stay
direct imports: modules/std/fs.sx etc.). log.sx's internal emit
renamed log_emit (it clobbered consumer fns named emit program-wide).
bundle.sx uses xml.escape via the carried alias. Consumer import paths
swept mechanically; .ir snapshots recaptured for the larger std
closure. m3te + game build unchanged.
This commit is contained in:
agra
2026-06-11 06:10:59 +03:00
parent ee00db849c
commit 59f0aa7716
112 changed files with 18612 additions and 15988 deletions

View File

@@ -31,7 +31,7 @@
#import "modules/std.sx";
#import "modules/compiler.sx";
proc :: #import "modules/process.sx";
proc :: #import "modules/std/process.sx";
libc :: #library "c";
@@ -54,7 +54,7 @@ ns_get_argc :: () -> *s32 #foreign libc "_NSGetArgc";
// value), `EX_UNAVAILABLE` when the platform is unsupported.
// 2. TERMINATORS. `exit_ok()` / `exit_usage()` end the process with the
// matching code. They route through the canonical
// `process.exit(code: u8)` (modules/process.sx) — there is NO second
// `process.exit(code: u8)` (modules/std/process.sx) — there is NO second
// hand-rolled `_exit` binding in this module; the unsupported-platform
// path below goes through `proc.exit(EX_UNAVAILABLE)` too.
//
@@ -62,7 +62,7 @@ ns_get_argc :: () -> *s32 #foreign libc "_NSGetArgc";
// `parsed.json` (true iff `--json` appears in the argv — see `Parsed.json`).
// The convention a front-end follows: in json mode stdout carries ONLY the
// machine result, and human diagnostics go to stderr (e.g. via
// `modules/log.sx`'s `log.err`). Detect json mode by reading `parsed.json`.
// `modules/std/log.sx`'s `log.err`). Detect json mode by reading `parsed.json`.
// =====================================================================
EX_OK :u8: 0; // success