pub enum Token {
Show 45 variants
Newline,
ParenOpen,
ParenClose,
CurlyOpen,
CurlyClose,
SquareOpen,
SquareClose,
Bang,
Tilde,
Pound,
Star,
Question,
Backslash,
Percent,
Dash,
Equals,
Plus,
Colon,
At,
Caret,
Slash,
Comma,
SingleQuote,
DoubleQuote,
Backtick,
Semi,
Amp,
Pipe,
AndIf,
OrIf,
DSemi,
Less,
Great,
DLess,
DGreat,
GreatAnd,
LessAnd,
DLessDash,
Clobber,
LessGreat,
Dollar,
ParamPositional(Positional),
Whitespace(String),
Literal(String),
Name(String),
}
Expand description
The representation of (context free) shell tokens.
Variants§
Newline
\n
ParenOpen
(
ParenClose
)
CurlyOpen
{
CurlyClose
}
SquareOpen
[
SquareClose
]
Bang
!
Tilde
~
Pound
#
Star
Question
?
Backslash
\
Percent
%
Dash
-
Equals
=
Plus
Colon
:
At
@
Caret
^
Slash
/
Comma
,
SingleQuote
’
DoubleQuote
“
Backtick
`
Semi
;
Amp
&
Pipe
|
AndIf
&&
OrIf
||
DSemi
;;
Less
<
Great
>
DLess
<<
DGreat
>>
GreatAnd
>&
LessAnd
<&
DLessDash
<<-
Clobber
>|
LessGreat
<>
Dollar
$
ParamPositional(Positional)
$0, $1, …, $9
Must be its own token to avoid lumping the positional parameter
as a Literal
if the parameter is concatenated to something.
Whitespace(String)
Any string of whitespace characters NOT including a newline.
Literal(String)
Any literal delimited by whitespace.
Name(String)
A Literal
capable of being used as a variable or function name. According to the POSIX
standard it should only contain alphanumerics or underscores, and does not start with a digit.
Implementations§
Trait Implementations§
impl Eq for Token
impl StructuralPartialEq for Token
Auto Trait Implementations§
impl Freeze for Token
impl RefUnwindSafe for Token
impl Send for Token
impl Sync for Token
impl Unpin for Token
impl UnwindSafe for Token
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