Struct conch_parser::ast::builder::CoreBuilder
[−]
[src]
pub struct CoreBuilder<T, W, C, F> { /* fields omitted */ }The actual provided Builder implementation.
The various type parameters are used to swap out atomic/non-atomic AST versions.
Methods
impl<T, W, C, F> CoreBuilder<T, W, C, F>[src]
fn new() -> Self
Constructs a builder.
Trait Implementations
impl<T, W, C, F> Debug for CoreBuilder<T, W, C, F>[src]
impl<T, W, C, F> Clone for CoreBuilder<T, W, C, F>[src]
fn clone(&self) -> Self
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
impl<T, W, C, F> Copy for CoreBuilder<T, W, C, F>[src]
impl<T, W, C, F> Default for CoreBuilder<T, W, C, F>[src]
impl<T, W, C, F> Builder for CoreBuilder<T, W, C, F> where
T: From<String>,
W: From<ShellWord<T, W, C>>,
C: From<Command<AndOrList<ListableCommand<PipeableCommand<T, Box<SimpleCommand<T, W, Redirect<W>>>, Box<ShellCompoundCommand<T, W, C>>, F>>>>>,
F: From<ShellCompoundCommand<T, W, C>>, [src]
T: From<String>,
W: From<ShellWord<T, W, C>>,
C: From<Command<AndOrList<ListableCommand<PipeableCommand<T, Box<SimpleCommand<T, W, Redirect<W>>>, Box<ShellCompoundCommand<T, W, C>>, F>>>>>,
F: From<ShellCompoundCommand<T, W, C>>,
type Command = C
The type which represents a complete, top-level command.
type CommandList = AndOrList<Self::ListableCommand>
The type which represents an and/or list of commands.
type ListableCommand = ListableCommand<Self::PipeableCommand>
The type which represents a command that can be used in an and/or command list.
type PipeableCommand = PipeableCommand<T, Box<SimpleCommand<T, W, Redirect<W>>>, Box<ShellCompoundCommand<T, W, C>>, F>
The type which represents a command that can be used in a pipeline.
type CompoundCommand = ShellCompoundCommand<T, Self::Word, Self::Command>
The type which represents compound commands like if, case, for, etc.
type Word = W
The type which represents shell words, which can be command names or arguments.
type Redirect = Redirect<Self::Word>
The type which represents a file descriptor redirection.
type Error = Void
A type for returning custom parse/build errors.
fn complete_command(
&mut self,
_pre_cmd_comments: Vec<Newline>,
list: Self::CommandList,
separator: SeparatorKind,
_cmd_comment: Option<Newline>
) -> Result<Self::Command, Self::Error>
&mut self,
_pre_cmd_comments: Vec<Newline>,
list: Self::CommandList,
separator: SeparatorKind,
_cmd_comment: Option<Newline>
) -> Result<Self::Command, Self::Error>
Constructs a Command::Job node with the provided inputs if the command
was delimited by an ampersand or the command itself otherwise.
fn and_or_list(
&mut self,
first: Self::ListableCommand,
rest: Vec<(Vec<Newline>, AndOr<Self::ListableCommand>)>
) -> Result<Self::CommandList, Self::Error>
&mut self,
first: Self::ListableCommand,
rest: Vec<(Vec<Newline>, AndOr<Self::ListableCommand>)>
) -> Result<Self::CommandList, Self::Error>
Constructs a Command::List node with the provided inputs.
fn pipeline(
&mut self,
bang: bool,
cmds: Vec<(Vec<Newline>, Self::PipeableCommand)>
) -> Result<Self::ListableCommand, Self::Error>
&mut self,
bang: bool,
cmds: Vec<(Vec<Newline>, Self::PipeableCommand)>
) -> Result<Self::ListableCommand, Self::Error>
Constructs a Command::Pipe node with the provided inputs or a Command::Simple
node if only a single command with no status inversion is supplied.
fn simple_command(
&mut self,
redirects_or_env_vars: Vec<RedirectOrEnvVar<Self::Redirect, String, Self::Word>>,
redirects_or_cmd_words: Vec<RedirectOrCmdWord<Self::Redirect, Self::Word>>
) -> Result<Self::PipeableCommand, Self::Error>
&mut self,
redirects_or_env_vars: Vec<RedirectOrEnvVar<Self::Redirect, String, Self::Word>>,
redirects_or_cmd_words: Vec<RedirectOrCmdWord<Self::Redirect, Self::Word>>
) -> Result<Self::PipeableCommand, Self::Error>
Constructs a Command::Simple node with the provided inputs.
fn brace_group(
&mut self,
cmd_group: CommandGroup<Self::Command>,
redirects: Vec<Self::Redirect>
) -> Result<Self::CompoundCommand, Self::Error>
&mut self,
cmd_group: CommandGroup<Self::Command>,
redirects: Vec<Self::Redirect>
) -> Result<Self::CompoundCommand, Self::Error>
Constructs a CompoundCommand::Brace node with the provided inputs.
fn subshell(
&mut self,
cmd_group: CommandGroup<Self::Command>,
redirects: Vec<Self::Redirect>
) -> Result<Self::CompoundCommand, Self::Error>
&mut self,
cmd_group: CommandGroup<Self::Command>,
redirects: Vec<Self::Redirect>
) -> Result<Self::CompoundCommand, Self::Error>
Constructs a CompoundCommand::Subshell node with the provided inputs.
fn loop_command(
&mut self,
kind: LoopKind,
guard_body_pair: GuardBodyPairGroup<Self::Command>,
redirects: Vec<Self::Redirect>
) -> Result<Self::CompoundCommand, Self::Error>
&mut self,
kind: LoopKind,
guard_body_pair: GuardBodyPairGroup<Self::Command>,
redirects: Vec<Self::Redirect>
) -> Result<Self::CompoundCommand, Self::Error>
Constructs a CompoundCommand::Loop node with the provided inputs.
fn if_command(
&mut self,
fragments: IfFragments<Self::Command>,
redirects: Vec<Self::Redirect>
) -> Result<Self::CompoundCommand, Self::Error>
&mut self,
fragments: IfFragments<Self::Command>,
redirects: Vec<Self::Redirect>
) -> Result<Self::CompoundCommand, Self::Error>
Constructs a CompoundCommand::If node with the provided inputs.
fn for_command(
&mut self,
fragments: ForFragments<Self::Word, Self::Command>,
redirects: Vec<Self::Redirect>
) -> Result<Self::CompoundCommand, Self::Error>
&mut self,
fragments: ForFragments<Self::Word, Self::Command>,
redirects: Vec<Self::Redirect>
) -> Result<Self::CompoundCommand, Self::Error>
Constructs a CompoundCommand::For node with the provided inputs.
fn case_command(
&mut self,
fragments: CaseFragments<Self::Word, Self::Command>,
redirects: Vec<Self::Redirect>
) -> Result<Self::CompoundCommand, Self::Error>
&mut self,
fragments: CaseFragments<Self::Word, Self::Command>,
redirects: Vec<Self::Redirect>
) -> Result<Self::CompoundCommand, Self::Error>
Constructs a CompoundCommand::Case node with the provided inputs.
fn compound_command_into_pipeable(
&mut self,
cmd: Self::CompoundCommand
) -> Result<Self::PipeableCommand, Self::Error>
&mut self,
cmd: Self::CompoundCommand
) -> Result<Self::PipeableCommand, Self::Error>
Converts a CompoundCommand into a PipeableCommand.
fn function_declaration(
&mut self,
name: String,
_post_name_comments: Vec<Newline>,
body: Self::CompoundCommand
) -> Result<Self::PipeableCommand, Self::Error>
&mut self,
name: String,
_post_name_comments: Vec<Newline>,
body: Self::CompoundCommand
) -> Result<Self::PipeableCommand, Self::Error>
Constructs a Command::FunctionDef node with the provided inputs.
fn comments(&mut self, _comments: Vec<Newline>) -> Result<(), Self::Error>
Ignored by the builder.
fn word(
&mut self,
kind: ComplexWordKind<Self::Command>
) -> Result<Self::Word, Self::Error>
&mut self,
kind: ComplexWordKind<Self::Command>
) -> Result<Self::Word, Self::Error>
Constructs a ast::Word from the provided input.
fn redirect(
&mut self,
kind: RedirectKind<Self::Word>
) -> Result<Self::Redirect, Self::Error>
&mut self,
kind: RedirectKind<Self::Word>
) -> Result<Self::Redirect, Self::Error>
Constructs a ast::Redirect from the provided input.