Skip to main content

Module fy

Module fy 

Source
Expand description

$fy: rule-based translation of shell scripts into command-stream modules.

The pipeline has two halves, exactly as link-foundation/meta-language models translation:

  1. Formalize: shell source -> links network (formalizer)
  2. Substitute: links network -> JavaScript (rules + engine)

Step 2 contains no shell knowledge beyond the rule table, and step 1 contains no JavaScript knowledge at all.

Re-exports§

pub use source::translate_competitor_source;
pub use source::translate_shell_program;
pub use source::translate_source;
pub use source::SourceOptions;

Modules§

cli
Shared options for the virtual command and the native CLI.
engine
Recursive rule engine for translating a meta-language links network.
formalizer
Formalizes a shell script as a meta-language links network.
lexer
Shell lexer for the $fy translator.
parser
Recursive-descent shell parser for the $fy translator.
rules
The Shell -> JavaScript substitution rules.
source
Lossless source migration: parse, formalize typed links, substitute rules.
word_expander
Splits a shell word into typed parts so that every leaf of the network is translated by a rule rather than by ad-hoc string surgery.

Structs§

TranslateOptions
Options for translate_shell_to_mjs.
Translation
A translated module.

Functions§

translate_shell_to_mjs
Translates a shell script into a command-stream ES module.