Expand description
JavaScript wiring for inline Rust FFI (rust { ... } blocks).
The heavy lifting lives in fusevm: fusevm::RustSugar scans and rewrites
the block at the source level, and fusevm::ffi compiles/loads/marshals
it. This module only supplies the JS-flavored fusevm::RustSugar config
and the desugar entry the parser calls. The emitted __rust_compile(...)
call and every exported bareword are resolved in crate::host::call_named.
Constants§
- SUGAR
- JavaScript desugar config: C-family braces with
//and/* */comments.newline_boundaryistrueso a top-levelrust { ... }on its own line is recognized —rust {is never valid JS otherwise, so this only ever matches an intended FFI block. The desugar runs on raw source BEFORE lexing, so the block is replaced in place by a__rust_compile(...)expression statement.
Functions§
- desugar
- Rewrite every top-level
rust { ... }block in JS source into a__rust_compile(...)call, before lexing. No-op when the source has norusttoken.