#[non_exhaustive]pub enum TokenizerError {
Show 16 variants
UnterminatedEscapeSequence,
UnterminatedSingleQuote(SourcePosition),
UnterminatedAnsiCQuote(SourcePosition),
UnterminatedDoubleQuote(SourcePosition),
UnterminatedBackquote(SourcePosition),
UnterminatedExtendedGlob(SourcePosition),
UnterminatedVariable,
UnterminatedCommandSubstitution,
UnterminatedExpansion,
FailedDecoding,
MissingHereTagForDocumentBody,
MissingHereTag(String),
MissingHereTagAtEndOfInput,
UnterminatedHereDocuments(String, String),
ExpansionNestingTooDeep,
ReadError(Error),
}Expand description
Represents an error that occurred during tokenization.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
UnterminatedEscapeSequence
An unterminated escape sequence was encountered at the end of the input stream.
UnterminatedSingleQuote(SourcePosition)
An unterminated single-quoted substring was encountered at the end of the input stream.
UnterminatedAnsiCQuote(SourcePosition)
An unterminated ANSI C-quoted substring was encountered at the end of the input stream.
UnterminatedDoubleQuote(SourcePosition)
An unterminated double-quoted substring was encountered at the end of the input stream.
UnterminatedBackquote(SourcePosition)
An unterminated back-quoted substring was encountered at the end of the input stream.
UnterminatedExtendedGlob(SourcePosition)
An unterminated extended glob (extglob) pattern was encountered at the end of the input stream.
UnterminatedVariable
An unterminated variable expression was encountered at the end of the input stream.
UnterminatedCommandSubstitution
An unterminated command substitiion was encountered at the end of the input stream.
UnterminatedExpansion
An unterminated arithmetic or other expansion was encountered at the end of the input stream.
FailedDecoding
An error occurred decoding UTF-8 characters in the input stream.
MissingHereTagForDocumentBody
A here-document body was due with no here tag recorded for it. This reflects an inconsistency in the tokenizer’s own state, not a problem with the input.
MissingHereTag(String)
A here-document operator (<< or <<-) was followed by an operator (e.g., a newline,
; or )) where its tag belongs; the string is that operator.
MissingHereTagAtEndOfInput
The input ended after a here-document operator (<< or <<-) and before its tag, but
not right at the operator (e.g., after blanks following it). Input ending right at the
operator (even after a line continuation, which is removed) tokenizes, leaving the parser
to report its end. Unlike TokenizerError::MissingHereTag, more input could still
supply the tag.
UnterminatedHereDocuments(String, String)
An unterminated here document sequence was encountered at the end of the input stream.
ExpansionNestingTooDeep
Expansions delimited by brackets ($(...), $((...)), $[...] and ${...}) were
nested in one another more deeply than the tokenizer supports.
ReadError(Error)
An I/O error occurred while reading from the input stream.
Implementations§
Source§impl TokenizerError
impl TokenizerError
Sourcepub const fn is_incomplete(&self) -> bool
pub const fn is_incomplete(&self) -> bool
Returns true if the error represents an error that could possibly be due to an incomplete input stream.
Trait Implementations§
Source§impl Debug for TokenizerError
impl Debug for TokenizerError
Source§impl Display for TokenizerError
impl Display for TokenizerError
Source§impl Error for TokenizerError
impl Error for TokenizerError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()