pub enum ParseError {
Show 15 variants
SyntaxError {
message: String,
line: usize,
column: usize,
},
UnsupportedExpression {
kind: String,
span: Option<String>,
},
GrammarError(String),
UndefinedEntity {
name: String,
line: usize,
column: usize,
},
UndefinedResource {
name: String,
line: usize,
column: usize,
},
UndefinedVariable {
name: String,
line: usize,
column: usize,
},
DuplicateDeclaration {
name: String,
line: usize,
column: usize,
},
TypeError {
message: String,
location: String,
},
InvalidExpression(String),
InvalidQuantity(String),
Validation(String),
NamespaceNotFound {
namespace: String,
line: usize,
column: usize,
suggestion: Option<String>,
},
ModuleNotFound {
module_path: String,
line: usize,
column: usize,
},
SymbolNotExported {
symbol: String,
module: String,
line: usize,
column: usize,
available_exports: Vec<String>,
},
CircularDependency {
cycle: Vec<String>,
},
}Variants§
SyntaxError
UnsupportedExpression
GrammarError(String)
UndefinedEntity
UndefinedResource
UndefinedVariable
DuplicateDeclaration
TypeError
InvalidExpression(String)
InvalidQuantity(String)
Validation(String)
NamespaceNotFound
E500: Referenced namespace does not exist
ModuleNotFound
E503: Referenced module file could not be found
SymbolNotExported
E504: Imported symbol is not exported by the target module
CircularDependency
E505: Circular dependency detected between modules
Implementations§
Source§impl ParseError
impl ParseError
pub fn from_pest(err: PestError<Rule>) -> Self
pub fn syntax_error( message: impl Into<String>, line: usize, column: usize, ) -> Self
pub fn undefined_entity( name: impl Into<String>, line: usize, column: usize, ) -> Self
Sourcepub fn undefined_entity_no_loc(name: impl Into<String>) -> Self
pub fn undefined_entity_no_loc(name: impl Into<String>) -> Self
Creates an UndefinedEntity error without location information (uses 0:0)
pub fn undefined_resource( name: impl Into<String>, line: usize, column: usize, ) -> Self
Sourcepub fn undefined_resource_no_loc(name: impl Into<String>) -> Self
pub fn undefined_resource_no_loc(name: impl Into<String>) -> Self
Creates an UndefinedResource error without location information (uses 0:0)
pub fn undefined_variable( name: impl Into<String>, line: usize, column: usize, ) -> Self
pub fn duplicate_declaration( name: impl Into<String>, line: usize, column: usize, ) -> Self
Sourcepub fn duplicate_declaration_no_loc(name: impl Into<String>) -> Self
pub fn duplicate_declaration_no_loc(name: impl Into<String>) -> Self
Creates a DuplicateDeclaration error without location information (uses 0:0)
pub fn type_error( message: impl Into<String>, location: impl Into<String>, ) -> Self
Sourcepub fn namespace_not_found(
namespace: impl Into<String>,
line: usize,
column: usize,
suggestion: Option<String>,
) -> Self
pub fn namespace_not_found( namespace: impl Into<String>, line: usize, column: usize, suggestion: Option<String>, ) -> Self
E500: Namespace not found error
Sourcepub fn module_not_found(
module_path: impl Into<String>,
line: usize,
column: usize,
) -> Self
pub fn module_not_found( module_path: impl Into<String>, line: usize, column: usize, ) -> Self
E503: Module not found error
Sourcepub fn symbol_not_exported(
symbol: impl Into<String>,
module: impl Into<String>,
line: usize,
column: usize,
available_exports: Vec<String>,
) -> Self
pub fn symbol_not_exported( symbol: impl Into<String>, module: impl Into<String>, line: usize, column: usize, available_exports: Vec<String>, ) -> Self
E504: Symbol not exported error
Sourcepub fn circular_dependency(cycle: Vec<String>) -> Self
pub fn circular_dependency(cycle: Vec<String>) -> Self
E505: Circular dependency error
Trait Implementations§
Source§impl Clone for ParseError
impl Clone for ParseError
Source§fn clone(&self) -> ParseError
fn clone(&self) -> ParseError
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ParseError
impl Debug for ParseError
Source§impl Display for ParseError
impl Display for ParseError
Source§impl Error for ParseError
impl Error for ParseError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Auto Trait Implementations§
impl Freeze for ParseError
impl RefUnwindSafe for ParseError
impl Send for ParseError
impl Sync for ParseError
impl Unpin for ParseError
impl UnwindSafe for ParseError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more