You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Proposal: docs/runtime-error-source-line-proposal.md (both phases now shipped).
2a — per-line source-file provenance:
- struct line gains src_file (interned path; NULL = top-level program).
- #INCLUDEd lines stamped with their origin during load via a g_load_src_file
global set/restored around the recursive include call.
- runtime_diagnostic builds an "at <file>:N" location for included lines,
keeps "on line N" for top-level (no change for single-file programs).
- Paths interned in a bounded table (MAX_SRC_FILES=128); overflow degrades
to line-only.
2b — LASTERROR$() builtin + basic_get_lasterror() ccall export:
- runtime_diagnostic records its formatted header line into g_last_error.
- New FN_LASTERROR no-arg string builtin returns it ("" if none).
- Export added to all four WASM EXPORTED_FUNCTIONS lists.
2c — #OPTION DIAGNOSTICS / -diagnostics flag (default off):
- New diagnostics_mode global, directive + CLI flag in both arg parsers,
reset in basic_apply_arg_string.
- diag_http() helper emits a non-halting Warning (status 0 or >=400) at
HTTP$ / HTTPFETCH / BUFFERFETCH return sites when the mode is on; the
breadcrumb also populates LASTERROR$(). JSON parse-fail breadcrumbs left
for a later follow-up under the same directive.
Tests: include_error (at file:line), diagnostics_http (breadcrumb), and
lasterror_capture (stdout) added to tests/runtime_errors/ + a stdout-substring
check mode in the driver. Usage strings gain [-diagnostics]. Verified native +
basic-wasm node harness; full `make check` green.
0 commit comments