fluffos/.github/workflows
Yucong Sun 389d9f769c
lpcc: JSON-native stage outputs, wasm lpcc, disassembler fixes (#1283)
The compiler front-end's dumps are now JSON-native: each stage has ONE
model and its outputs (human text, --json envelope) are renderings of
it. lpcc ships in the wasm build so the fluffos-vscode extension can
bundle it with zero native setup.

--json stage outputs (one-line {"fluffos_lpcc":1,...} envelopes,
findable in mixed stdout; error_handler_t::replace everywhere since LPC
source bytes are not guaranteed UTF-8):

- tokens: positions, spellings, and token NAMES via lpc_token_name(),
  a new public accessor in grammar.y's epilogue over the parser's
  file-static yysymbol_name()/YYTRANSLATE table (grammar.autogen.*
  regenerated via the pinned copy-back)
- ast: per-node source LINES (absolute compilation-unit lines) plus a
  {"stage":"files"} companion envelope with the absolute-line->file
  segment table and the string table so (string N) atoms resolve.
  dump_tree's ~240-line hand-printed switch is GONE: the --ast text is
  render_sexpr() over the same ast_json model (one switch, two
  renderings; the rendered form is shape-compatible, one root per line,
  function nodes carry their index)
- bytecode (default and -O0, envelope carries optimized:true/false):
  the ONE opcode switch in disassemble() emits through a DisSink with
  two backends -- text reproduces the legacy dump format (verified
  byte-identical across a fixture corpus incl. switch tables and both
  optimizer modes), json builds the model natively: per-program
  sections (top + inherited), FUNCTIONS table via the shared
  fn_table_rows(), instruction rows {a,x,m,o,f,l} with source file:line
  NATIVE on every row, structured switch tables (resolved string keys,
  case targets, minval), and the line tables. dump_prog_json() exported
  via json_fwd

Disassembler fix folded in: loop_cond_number copied its 8-byte LPC_INT
literal (COPY_INT == COPY8) but advanced pc only 4, desyncing the
address stream -- '*** zero opcode ***' garbage and the next function's
listing swallowed. Advance sizeof(LPC_INT); 'bbranch_when_non_zero'
typo -> 'branch back'.

wasm: the emscripten branch builds lpcc-web (main_lpcc.cc as a plain
node CLI with NODERAWFS, so 'node lpcc.js <config> <file>' behaves like
the native binary; the unneeded event2 include is dropped -- mainlib.h
forward-declares init_main's event_base). Added to the wasm build
preset's target list, smoke-tested in the CI wasm job (compile a
testsuite file, expect the --json tokens envelope), and shipped in the
release wasm zip alongside the driver.

Full LPC testsuite passes; all stage outputs verified end-to-end by the
fluffos-vscode Compiler Explorer against fixture corpora.


Claude-Session: https://claude.ai/code/session_01AXqX4Kf55ArA39suS9cdCv

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-07-17 22:27:17 -07:00
..
ci.yml lpc-syntax: source-following LPC formatter with printWidth wrapping and full testsuite reformat (#1270) 2026-07-17 11:55:21 -07:00
codeql-analysis.yml build: add pkg-config and libffi to dependency lists (#1235) 2026-07-10 23:26:25 -04:00
config-docs.yml Generate driver config docs and a starter config from rc.cc tables (#1206) 2026-06-02 13:07:06 -04:00
coverity-scan.yml build: add pkg-config and libffi to dependency lists (#1235) 2026-07-10 23:26:25 -04:00
docker-publish.yml Add automated release workflow with multi-platform builds (#1160) 2025-12-04 15:07:27 -08:00
docs-sidebar.yml docs: fully-expandable generated sidebar + Chinese docs via Docusaurus i18n (#1246) 2026-07-11 17:20:25 -04:00
gh-pages.yml Fix Docusaurus sidebar, broken links, and gh-pages CI (#1209) 2026-06-24 21:01:21 -07:00
release.yml lpcc: JSON-native stage outputs, wasm lpcc, disassembler fixes (#1283) 2026-07-17 22:27:17 -07:00