This folder builds an autonomous WASM preprocessor for Node/LSP.
It does not depend on web/ artifacts.
out/mcpp.wasmout/mcpp_node.js(stable Node wrapper API)out/mcpp_core.js(Emscripten runtime glue)
From repository root:
make -C tools/mcpp-wasmThe build uses third_party/mcpp sources and compiles a dedicated bridge with Emscripten.
No system mcpp executable is required.
const mcpp = require("./out/mcpp_node.js");
const result = mcpp.preprocess(source, { file: "/path/file.pts" });
// result = { code, mapping: { preToOrigLine, origToPreLine } }The VSCode language server loads src/frontend.js, which loads this wrapper at:
tools/mcpp-wasm/out/mcpp_node.js
Before packaging/testing the VSCode extension, build this artifact:
npm --prefix tools/vscode/protoscript2 run build:mcpp-wasmCurrent test script already does this automatically.