[−][src]Enum luaparser::ParsingError
This enum represents the various errors that may happen while parsing tokens into an AST (abstract syntax tree).
Variants
After parsing the last statement of a block (break or return statement), the parser
expects a token to close the block (e.g. end
, until
, else
).
After parsing the last statement of a chunk (an entire file for example), the parser expects no more tokens.
After parsing a binary operator (+
, and
, or
, ==
, ...), the parser expects an
expression to form a binary expression.
The parser was expecting a token that can start a statement.
When parsing a block, a specific token is expected to close that block. For example,
when parsing a do statement, the parser expects the keyword end
to close the inner
block. For a repeat statement, the parser expects the until
keyword.
The parser was expecting the keyword function
The parser was expecting a (
to begin the parameters definition of a function.
The parser was expecting a )
to close the parameters definition of a function.
The parser expects a list of identifiers that may end with the variable arguments symbol
(...
), separated by commas. The error is return if another token is found.
The parser was expecting an expression after a unary operator (#
, -
or not
)
After opening a parenthese (as an expression, not a call to a function or method), the parser expects an expression.
When parsing a parenthese expression, the parser expects a closing parenthese after the expression.
When opening a bracket ([
) to index another value, the parse expects an expression
followed with a closing bracket (]
).
When parsing a method call, the parser expects arguments after the method name.
When parsing a table, the parser expects a closing brace to close that table.
The parser expects an expression after the =
when parsing a field entry in a table
({ key = expect_expression_here }
).
The parser expects an expression between brackets when parsing a table entry key
({ [expect_expression_here] = value }
).
After parsing a table entry key ([key] = ...
), the parser expects an assign symbol (=
).
When parsing a table key using brackets, the parser expects a closing bracket after the expression.
When parsing a while statement, the parser expects an expression after the while keyword.
When parsing a while statement, the parser expects the keyword do
after the condition.
When parsing a repeat statement, the parser expects an expression after the until keyword.
When parsing an if statement, an expression is expected after the if
keyword.
When parsing an if statement, an expression is expected after an elseif
keyword.
When parsing an if statement, a then
keyword is expected after the condition.
When parsing an else-if clase, a then
keyword is expected after the condition.
When declaring a numeric for statement, the parser expects an expression after the assign
symbol (=
) to specify the starting value.
When declaring a numeric for statement, the parser expects an expression after the comma
(,
) to specify the ending value.
When declaring a numeric for statement, the parser expects an expression after the comma following the end expression.
When declaring a numeric for statement, the parser expects a comma after the start expression.
When declaring a numeric for statement, the parser expects the keyword do
after the
ending expression or the step expression.
An identifier is expected after a for
keyword.
When parsing the identifier list of a generic for statement, the parser expects an identifier after each comma.
After parsing the identifier list of a generic for statement, the parser expects the in
keyword.
After the in
keyword, an expression is expected.
After parsing the expression list of a generic for statement, the parser
expects the do
keyword.
When parsing a local assignement, the parser expects at least one identifier.
When parsing a function definition, an identifier is expected after the function
keyword
or after every dot (.
) symbol in the function name.
The parser expects an identifier to access a field of an expression.
When parsing an assign statement, the parser expects an expression after the assign (=
)
symbol and after each commas following an expression after the assign symbol.
After a comma following a variable in an assign statement, another variable is expected.
Lexer(LexerErrorType)
Wraps the error thrown by the tokenization process.
Trait Implementations
impl Clone for ParsingError
[src]
fn clone(&self) -> ParsingError
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for ParsingError
[src]
Auto Trait Implementations
impl RefUnwindSafe for ParsingError
impl Send for ParsingError
impl Sync for ParsingError
impl Unpin for ParsingError
impl UnwindSafe for ParsingError
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,