Skip to main content

Module shell_compiler

Module shell_compiler 

Source
Expand description

Shell compiler — lowers zshrs AST to fusevm bytecodes.

This is the first phase of lowering. We start with arithmetic expressions ($((…))) since they’re pure computation with a direct 1:1 mapping to fusevm ops.

Subsequent phases will lower:

  • for/while/until loops → Jump/JumpIfFalse + fused superinstructions
  • shell functions → Call/Return/PushFrame/PopFrame
  • simple commands → Exec
  • pipelines → PipelineBegin/PipelineStage/PipelineEnd
  • conditionals [[ ]] → comparison ops + TestFile
  • variable expansion → GetVar + string ops

Structs§

ArithCompiler
Arithmetic expression compiler.
ShellCompiler
Compiles shell AST to fusevm bytecodes.