Enum conch_parser::ast::CompoundCommandKind
[−]
[src]
pub enum CompoundCommandKind<V, W, C> {
Brace(Vec<C>),
Subshell(Vec<C>),
While(GuardBodyPair<C>),
Until(GuardBodyPair<C>),
If {
conditionals: Vec<GuardBodyPair<C>>,
else_branch: Option<Vec<C>>,
},
For {
var: V,
words: Option<Vec<W>>,
body: Vec<C>,
},
Case {
word: W,
arms: Vec<PatternBodyPair<W, C>>,
},
}A specific kind of a CompoundCommand.
Generic over the representation of shell words and commands.
Variants
Brace(Vec<C>)A group of commands that should be executed in the current environment.
Subshell(Vec<C>)A group of commands that should be executed in a subshell environment.
While(GuardBodyPair<C>)A command that executes its body as long as its guard exits successfully.
Until(GuardBodyPair<C>)A command that executes its body as until as its guard exits unsuccessfully.
IfA conditional command that runs the respective command branch when a certain of the first condition that exits successfully.
Fields of If
conditionals: Vec<GuardBodyPair<C>> | A list of conditional branch-body pairs. |
else_branch: Option<Vec<C>> | An else part to run if no other conditional was taken. |
ForA command that binds a variable to a number of provided words and runs its body once for each binding.
Fields of For
var: V | The variable to bind to each of the specified words. |
words: Option<Vec<W>> | The words to bind to the specified variable one by one. |
body: Vec<C> | The body to run with the variable binding. |
CaseA command that behaves much like a match statment in Rust, running
a branch of commands if a specified word matches another literal or
glob pattern.
Fields of Case
word: W | The word on which to check for pattern matches. |
arms: Vec<PatternBodyPair<W, C>> | The arms to match against. |
Trait Implementations
impl<V: Debug, W: Debug, C: Debug> Debug for CompoundCommandKind<V, W, C>[src]
impl<V: PartialEq, W: PartialEq, C: PartialEq> PartialEq for CompoundCommandKind<V, W, C>[src]
fn eq(&self, __arg_0: &CompoundCommandKind<V, W, C>) -> bool
This method tests for self and other values to be equal, and is used by ==. Read more
fn ne(&self, __arg_0: &CompoundCommandKind<V, W, C>) -> bool
This method tests for !=.
impl<V: Eq, W: Eq, C: Eq> Eq for CompoundCommandKind<V, W, C>[src]
impl<V: Clone, W: Clone, C: Clone> Clone for CompoundCommandKind<V, W, C>[src]
fn clone(&self) -> CompoundCommandKind<V, W, C>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0
Performs copy-assignment from source. Read more