Skip to main content

Module compound_lexer

Module compound_lexer 

Source

Enums§

Segment
Splits a compound shell command into segments separated by &&, ||, ;. Pipes (|) are treated specially: only the left side of a pipe is eligible for rewriting (the right side consumes output format and must stay raw).

Functions§

rewrite_compound
Rewrites a compound command by applying a rewrite function to each command segment. Operators and pipe-right-hand segments are preserved unchanged. rewrite_fn receives a command string and returns Some(rewritten) if it should be rewritten, or None to keep the original.
split_compound