Expand description
The Shell -> JavaScript substitution rules.
Every construct the formalizer can produce has exactly one
TranslationRule here: a LinkQuery selecting the links it owns, plus one
template per target language. Nothing about the translation lives outside
this file — super::engine only walks the network and substitutes.
Four target languages express the four contexts a node can appear in:
| language | context | example |
|---|---|---|
JavaScript | a statement | await $`ls`; |
JavaScript:command | text inside ``$`…``` | ls |
JavaScript:value | text inside `…` | ls without quoting |
JavaScript:expression | a JavaScript value | process.env.HOME |
Placeholder syntax is documented in super::engine.
Constants§
Functions§
- build_
rule_ set - Builds the Shell -> JavaScript rule set.
- language_
fallbacks - A
:valuerendering falls back to the:commandone when unquoting is a no-op. - modes
- Placeholder modes available to the templates below.