Enum yash_syntax::parser::SyntaxError
source · [−]#[non_exhaustive]
pub enum SyntaxError {
Show 55 variants
UnclosedParen {
opening_location: Location,
},
InvalidModifier,
MultipleModifier,
UnclosedSingleQuote {
opening_location: Location,
},
UnclosedDoubleQuote {
opening_location: Location,
},
UnclosedParam {
opening_location: Location,
},
EmptyParam,
UnclosedCommandSubstitution {
opening_location: Location,
},
UnclosedBackquote {
opening_location: Location,
},
UnclosedArith {
opening_location: Location,
},
InvalidCommandToken,
FdOutOfRange,
MissingRedirOperand,
MissingHereDocDelimiter,
MissingHereDocContent,
UnclosedHereDocContent {
redir_op_location: Location,
},
UnclosedArrayValue {
opening_location: Location,
},
UnclosedGrouping {
opening_location: Location,
},
EmptyGrouping,
UnclosedSubshell {
opening_location: Location,
},
EmptySubshell,
UnclosedDoClause {
opening_location: Location,
},
EmptyDoClause,
MissingForName,
InvalidForName,
InvalidForValue,
MissingForBody {
opening_location: Location,
},
UnclosedWhileClause {
opening_location: Location,
},
EmptyWhileCondition,
UnclosedUntilClause {
opening_location: Location,
},
EmptyUntilCondition,
IfMissingThen {
if_location: Location,
},
EmptyIfCondition,
EmptyIfBody,
ElifMissingThen {
elif_location: Location,
},
EmptyElifCondition,
EmptyElifBody,
EmptyElse,
UnclosedIf {
opening_location: Location,
},
MissingCaseSubject,
InvalidCaseSubject,
MissingIn {
opening_location: Location,
},
UnclosedPatternList,
MissingPattern,
InvalidPattern,
EsacAsPattern,
UnclosedCase {
opening_location: Location,
},
UnmatchedParenthesis,
MissingFunctionBody,
InvalidFunctionBody,
MissingPipeline(AndOr),
DoubleNegation,
BangAfterBar,
MissingCommandAfterBang,
MissingCommandAfterBar,
}Expand description
Types of syntax errors.
Variants (Non-exhaustive)
This enum is marked as non-exhaustive
UnclosedParen
Fields
opening_location: LocationA ( lacks a closing ).
InvalidModifier
A modifier does not have a valid form in a parameter expansion.
MultipleModifier
A braced parameter expansion has both a prefix and suffix modifier.
UnclosedSingleQuote
Fields
opening_location: LocationA single quotation lacks a closing '.
UnclosedDoubleQuote
Fields
opening_location: LocationA double quotation lacks a closing ".
UnclosedParam
Fields
opening_location: LocationA parameter expansion lacks a closing }.
EmptyParam
A parameter expansion lacks a name.
UnclosedCommandSubstitution
Fields
opening_location: LocationA command substitution started with $( but lacks a closing ).
UnclosedBackquote
Fields
opening_location: LocationA command substitution started with ` but lacks a closing `.
UnclosedArith
Fields
opening_location: LocationAn arithmetic expansion lacks a closing )).
InvalidCommandToken
A command begins with an inappropriate keyword or operator token.
FdOutOfRange
The file descriptor specified for a redirection cannot be used.
MissingRedirOperand
A redirection operator is missing its operand.
MissingHereDocDelimiter
A here-document operator is missing its delimiter token.
MissingHereDocContent
A here-document operator is missing its corresponding content.
UnclosedHereDocContent
Fields
redir_op_location: LocationA here-document content is missing its delimiter.
UnclosedArrayValue
Fields
opening_location: LocationAn array assignment started with =( but lacks a closing ).
UnclosedGrouping
Fields
opening_location: LocationA grouping is not closed.
EmptyGrouping
A grouping contains no commands.
UnclosedSubshell
Fields
opening_location: LocationA subshell is not closed.
EmptySubshell
A subshell contains no commands.
UnclosedDoClause
Fields
opening_location: LocationA do clause is not closed.
EmptyDoClause
A do clause contains no commands.
MissingForName
The variable name is missing in a for loop.
InvalidForName
The variable name is not a valid word in a for loop.
InvalidForValue
A value is not a valid word in a for loop.
MissingForBody
Fields
opening_location: LocationA for loop is missing a do clause.
UnclosedWhileClause
Fields
opening_location: LocationA while loop is missing a do clause.
EmptyWhileCondition
A while loop’s condition is empty.
UnclosedUntilClause
Fields
opening_location: LocationAn until loop is missing a do clause.
EmptyUntilCondition
An until loop’s condition is empty.
IfMissingThen
Fields
if_location: LocationAn if command is missing the then clause.
EmptyIfCondition
An if command’s condition is empty.
EmptyIfBody
An if command’s body is empty.
ElifMissingThen
Fields
elif_location: LocationAn elif clause is missing the then clause.
EmptyElifCondition
An elif clause’s condition is empty.
EmptyElifBody
An elif clause’s body is empty.
EmptyElse
An else clause is empty.
UnclosedIf
Fields
opening_location: LocationAn if command is not closed.
MissingCaseSubject
The case command is missing its subject.
InvalidCaseSubject
The subject of the case command is not a valid word.
MissingIn
Fields
opening_location: LocationThe case command is missing in after the subject.
UnclosedPatternList
The ) is missing in a case item.
MissingPattern
The pattern is missing in a case item.
InvalidPattern
The pattern is not a valid word token.
EsacAsPattern
The first pattern of a case item is esac.
UnclosedCase
Fields
opening_location: LocationA case command is not closed.
UnmatchedParenthesis
The ( is not followed by ) in a function definition.
MissingFunctionBody
The function body is missing in a function definition command.
InvalidFunctionBody
A function body is not a compound command.
MissingPipeline(AndOr)
A pipeline is missing after a && or || token.
DoubleNegation
Two successive ! tokens.
BangAfterBar
A | token is followed by a !.
MissingCommandAfterBang
A command is missing after a ! token.
MissingCommandAfterBar
A command is missing after a | token.
Implementations
Trait Implementations
sourceimpl Clone for SyntaxError
impl Clone for SyntaxError
sourcefn clone(&self) -> SyntaxError
fn clone(&self) -> SyntaxError
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl Debug for SyntaxError
impl Debug for SyntaxError
sourceimpl Display for SyntaxError
impl Display for SyntaxError
sourceimpl From<SyntaxError> for ErrorCause
impl From<SyntaxError> for ErrorCause
sourcefn from(e: SyntaxError) -> ErrorCause
fn from(e: SyntaxError) -> ErrorCause
Converts to this type from the input type.
sourceimpl PartialEq<SyntaxError> for SyntaxError
impl PartialEq<SyntaxError> for SyntaxError
sourcefn eq(&self, other: &SyntaxError) -> bool
fn eq(&self, other: &SyntaxError) -> bool
This method tests for self and other values to be equal, and is used
by ==. Read more
sourcefn ne(&self, other: &SyntaxError) -> bool
fn ne(&self, other: &SyntaxError) -> bool
This method tests for !=.
impl Eq for SyntaxError
impl StructuralEq for SyntaxError
impl StructuralPartialEq for SyntaxError
Auto Trait Implementations
impl !RefUnwindSafe for SyntaxError
impl !Send for SyntaxError
impl !Sync for SyntaxError
impl Unpin for SyntaxError
impl !UnwindSafe for SyntaxError
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more