struct ParseState {
ret: ParsedJob,
command: Option<CommandWithArgs>,
stdio: Redirects,
token: Option<String>,
last_ch: char,
current_seq: SeqType,
}
Fields§
§ret: ParsedJob
§command: Option<CommandWithArgs>
§stdio: Redirects
§token: Option<String>
§last_ch: char
§current_seq: SeqType
Implementations§
Source§impl ParseState
impl ParseState
fn new() -> Self
fn command(&mut self) -> &mut CommandWithArgs
fn token(&mut self) -> &mut String
fn take_token(&mut self) -> String
Sourcefn strip_quotes(&mut self, token: &str)
fn strip_quotes(&mut self, token: &str)
Strip single quotes and Escapes from a string and then save it as an arg. Note double quoted strings will have already been “resolved” and made single quoted by now so no need to strip double quotes.
Sourcefn expand_globs(&mut self, token: &str)
fn expand_globs(&mut self, token: &str)
Expand tokens that are file expansions (globs) into multiple arguments.
Sourcefn expand_params_comms(
&mut self,
jobs: &mut Jobs,
token: &str,
) -> Result<(), Error>
fn expand_params_comms( &mut self, jobs: &mut Jobs, token: &str, ) -> Result<(), Error>
Expand tokens that contain unquoted $ chars.
Sourcefn expand_tildes(&mut self, jobs: &mut Jobs, token: &str) -> Result<(), Error>
fn expand_tildes(&mut self, jobs: &mut Jobs, token: &str) -> Result<(), Error>
Expand ~ into home directory. TODO support other tilde expansions from https://www.gnu.org/software/bash/manual/html_node/Tilde-Expansion.html
Sourcefn expand_braces(&mut self, jobs: &mut Jobs, token: &str) -> Result<(), Error>
fn expand_braces(&mut self, jobs: &mut Jobs, token: &str) -> Result<(), Error>
Expand {..} expressions in arguments into multiple arguments. TODO Add range expressions, see https://www.gnu.org/software/bash/manual/html_node/Brace-Expansion.html
Sourcefn proc_token(&mut self, jobs: &mut Jobs) -> Result<(), Error>
fn proc_token(&mut self, jobs: &mut Jobs) -> Result<(), Error>
Process a token by applying expansions and saving to argument list. TODO add process substitution and word splitting.
fn end_command(&mut self, background: bool)
fn pipe_or( &mut self, jobs: &mut Jobs, ch: char, next_char: char, ) -> Result<(), Error>
fn seq(&mut self, jobs: &mut Jobs) -> Result<(), Error>
fn and(&mut self, jobs: &mut Jobs) -> Result<(), Error>
fn redir_out( &mut self, jobs: &mut Jobs, chars: &mut Peekable<Chars<'_>>, end_char: Option<char>, ) -> Result<(), Error>
fn redir_in( &mut self, jobs: &mut Jobs, chars: &mut Peekable<Chars<'_>>, end_char: Option<char>, ) -> Result<(), Error>
fn expand_var_or_command( &mut self, jobs: &mut Jobs, chars: &mut Peekable<Chars<'_>>, end_char: Option<char>, ) -> Result<String, Error>
Trait Implementations§
Source§impl Debug for ParseState
impl Debug for ParseState
Source§impl From<ParseState> for ParsedJob
impl From<ParseState> for ParsedJob
Source§fn from(value: ParseState) -> Self
fn from(value: ParseState) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for ParseState
impl RefUnwindSafe for ParseState
impl Send for ParseState
impl Sync for ParseState
impl Unpin for ParseState
impl UnwindSafe for ParseState
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more