pub enum TokenType {
Show 50 variants
Eof,
Word,
AssignmentWord,
Number,
Newline,
Pipe,
PipeBoth,
And,
Or,
Semi,
DoubleSemi,
SemiAnd,
SemiSemiAnd,
Ampersand,
LeftParen,
RightParen,
LeftBrace,
RightBrace,
DoubleLeftBracket,
DoubleRightBracket,
Less,
Greater,
DoubleLess,
DoubleGreater,
LessAnd,
GreaterAnd,
LessGreater,
DoubleLessDash,
TripleLess,
GreaterPipe,
AndGreater,
AndDoubleGreater,
Bang,
If,
Then,
Else,
Elif,
Fi,
Do,
Done,
Case,
Esac,
While,
Until,
For,
Select,
In,
Function,
Time,
Coproc,
}Expand description
Token types produced by the lexer.
These map to Parable’s TokenType constants for compatibility.
Variants§
Eof
End of input.
Word
A word (command name, argument, etc.).
AssignmentWord
An assignment word (e.g., FOO=bar).
Number
A numeric literal in redirect context.
Newline
A newline character.
Pipe
Pipe operator |.
PipeBoth
Pipe-both operator |&.
And
AND operator &&.
Or
OR operator ||.
Semi
Semicolon ;.
DoubleSemi
Double semicolon ;;.
SemiAnd
Semicolon-ampersand ;&.
SemiSemiAnd
Semicolon-semicolon-ampersand ;;&.
Ampersand
Ampersand &.
LeftParen
Left parenthesis (.
RightParen
Right parenthesis ).
LeftBrace
Left brace {.
RightBrace
Right brace }.
DoubleLeftBracket
Double left bracket [[.
DoubleRightBracket
Double right bracket ]].
Less
Less-than <.
Greater
Greater-than >.
DoubleLess
Double less-than << (here-document).
DoubleGreater
Double greater-than >> (append).
LessAnd
Less-ampersand <&.
GreaterAnd
Greater-ampersand >&.
LessGreater
Less-greater <>.
DoubleLessDash
Double less-dash <<- (here-document with tab stripping).
TripleLess
Triple less-than <<< (here-string).
GreaterPipe
Greater-pipe >| (clobber).
AndGreater
Ampersand-greater &>.
AndDoubleGreater
Ampersand-double-greater &>>.
Bang
Bang !.
If
Then
Else
Elif
Fi
Do
Done
Case
Esac
While
Until
For
Select
In
Function
Time
Coproc
Implementations§
Source§impl TokenType
impl TokenType
Sourcepub fn reserved_word(s: &str) -> Option<Self>
pub fn reserved_word(s: &str) -> Option<Self>
Returns the reserved word token type for the given string, if any.
Sourcepub const fn starts_command(self) -> bool
pub const fn starts_command(self) -> bool
Returns true if this token type starts a compound command.