Enum leo_errors::errors::parser::parser_errors::ParserError
source · pub enum ParserError {
Formatted(Formatted),
Backtraced(Backtraced),
}
Expand description
ParserError enum that represents all the errors for the leo-parser
crate.
Variants§
Formatted(Formatted)
Backtraced(Backtraced)
Implementations§
source§impl ParserError
impl ParserError
sourcepub fn unexpected_token(message: impl Display, span: Span) -> Self
pub fn unexpected_token(message: impl Display, span: Span) -> Self
For when the parser encountered an unexpected token.
sourcepub fn invalid_address_lit(token: impl Display, span: Span) -> Self
pub fn invalid_address_lit(token: impl Display, span: Span) -> Self
For when the parser encountered an invalid address literal.
sourcepub fn invalid_import_list(span: Span) -> Self
pub fn invalid_import_list(span: Span) -> Self
For when the parser encountered an empty import list.
sourcepub fn unexpected_eof(span: Span) -> Self
pub fn unexpected_eof(span: Span) -> Self
For when the parser encountered an unexpected End of File.
sourcepub fn unexpected_whitespace(
left: impl Display,
right: impl Display,
span: Span
) -> Self
pub fn unexpected_whitespace( left: impl Display, right: impl Display, span: Span ) -> Self
For when the parser encountered an unexpected whitespace.
sourcepub fn unexpected(
found: impl Display,
expected: impl Display,
span: Span
) -> Self
pub fn unexpected( found: impl Display, expected: impl Display, span: Span ) -> Self
For when the parser encountered an unexpected list of tokens.
sourcepub fn mixed_commas_and_semicolons(span: Span) -> Self
pub fn mixed_commas_and_semicolons(span: Span) -> Self
For when the parser encountered a mix of commas and semi-colons in struct member variables.
sourcepub fn unexpected_ident(
found: impl Display,
expected: &[impl Display],
span: Span
) -> Self
pub fn unexpected_ident( found: impl Display, expected: &[impl Display], span: Span ) -> Self
For when the parser encountered an unexpected identifier.
sourcepub fn unexpected_statement(
found: impl Display,
expected: impl Display,
span: Span
) -> Self
pub fn unexpected_statement( found: impl Display, expected: impl Display, span: Span ) -> Self
For when the parser encountered an unexpected statement.
sourcepub fn unexpected_str(
found: impl Display,
expected: impl Display,
span: Span
) -> Self
pub fn unexpected_str( found: impl Display, expected: impl Display, span: Span ) -> Self
For when the parser encountered an unexpected string.
sourcepub fn spread_in_array_init(span: Span) -> Self
pub fn spread_in_array_init(span: Span) -> Self
For when the parser encountered an unexpected spread in an array init expression.
sourcepub fn lexer_empty_input() -> Self
pub fn lexer_empty_input() -> Self
When more input was expected but not found.
sourcepub fn lexer_expected_valid_escaped_char(input: impl Display) -> Self
pub fn lexer_expected_valid_escaped_char(input: impl Display) -> Self
When an integer is started with a leading zero.
sourcepub fn lexer_string_not_closed(input: impl Display) -> Self
pub fn lexer_string_not_closed(input: impl Display) -> Self
When a string is not properly closed.
sourcepub fn lexer_empty_block_comment() -> Self
pub fn lexer_empty_block_comment() -> Self
When a block comment is empty.
sourcepub fn lexer_block_comment_does_not_close_before_eof(
input: impl Display
) -> Self
pub fn lexer_block_comment_does_not_close_before_eof( input: impl Display ) -> Self
When a block comment is not closed before end of file.
sourcepub fn could_not_lex(input: impl Display) -> Self
pub fn could_not_lex(input: impl Display) -> Self
When the lexer could not lex some text.
sourcepub fn implicit_values_not_allowed(input: impl Display, span: Span) -> Self
pub fn implicit_values_not_allowed(input: impl Display, span: Span) -> Self
When the user tries to pass an implicit value.
sourcepub fn lexer_hex_number_provided(input: impl Display) -> Self
pub fn lexer_hex_number_provided(input: impl Display) -> Self
When a hex number is provided.
sourcepub fn inputs_multiple_variable_modes_specified(span: Span) -> Self
pub fn inputs_multiple_variable_modes_specified(span: Span) -> Self
For when a user specified more than one mode on a parameter.
sourcepub fn lexer_bidi_override() -> Self
pub fn lexer_bidi_override() -> Self
For when the lexer encountered a bidi override character
sourcepub fn invalid_method_call(
expr: impl Display,
func: impl Display,
num_args: impl Display,
span: Span
) -> Self
pub fn invalid_method_call( expr: impl Display, func: impl Display, num_args: impl Display, span: Span ) -> Self
Parsed an unknown method call on the type of an expression.
pub fn invalid_associated_access(name: impl Display, span: Span) -> Self
pub fn leo_imports_only(span: Span) -> Self
pub fn space_in_annotation(span: Span) -> Self
pub fn circuit_is_deprecated(span: Span) -> Self
pub fn only_one_program_scope_is_allowed(span: Span) -> Self
pub fn missing_program_scope(span: Span) -> Self
pub fn invalid_network(span: Span) -> Self
pub fn tuple_must_have_at_least_two_elements( kind: impl Display, span: Span ) -> Self
pub fn async_finalize_is_deprecated(span: Span) -> Self
pub fn finalize_statements_are_deprecated(span: Span) -> Self
pub fn console_statements_are_not_yet_supported(span: Span) -> Self
pub fn num_exit_codes() -> i32
Trait Implementations§
source§impl Clone for ParserError
impl Clone for ParserError
source§fn clone(&self) -> ParserError
fn clone(&self) -> ParserError
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for ParserError
impl Debug for ParserError
source§impl Display for ParserError
impl Display for ParserError
source§impl Error for ParserError
impl Error for ParserError
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
source§impl From<Backtraced> for ParserError
impl From<Backtraced> for ParserError
source§fn from(source: Backtraced) -> Self
fn from(source: Backtraced) -> Self
source§impl From<Formatted> for ParserError
impl From<Formatted> for ParserError
source§impl From<ParserError> for LeoError
impl From<ParserError> for LeoError
source§fn from(source: ParserError) -> Self
fn from(source: ParserError) -> Self
source§impl LeoMessageCode for ParserError
impl LeoMessageCode for ParserError
Implements the trait for LeoError Codes.