#[non_exhaustive]pub enum JuteError {
Show 19 variants
InvalidConversionToPremitive {
token: String,
},
UnexpectedToken {
token: Option<String>,
message: String,
},
UnexpectedChar {
c: char,
message: String,
},
UnexpectedEndOfTokenStream,
UnexpectedEndOfFile,
PathCanonicalizeError {
message: String,
},
UnTerminatedMultiLineComment,
UnTerminatedQuotedString,
QuotedStringWithNewLineCharacter,
UnknownType {
name: String,
_type: String,
record: String,
module: String,
file: PathBuf,
},
AmbiguousType {
name: String,
_type: String,
record: String,
module: String,
file: PathBuf,
},
CircularDependency {
cycle: String,
},
Io(Error),
Fmt(Error),
Utf8(FromUtf8Error),
DuplicateModuleName {
module_name: String,
file_name: PathBuf,
},
DuplicateClassName {
class_name: String,
module_name: String,
file_name: PathBuf,
},
DuplicateFieldName {
field_name: String,
class_name: String,
module_name: String,
file_name: PathBuf,
},
InvalidFieldType {
field_type: String,
field_name: String,
class_name: String,
module_name: String,
file_name: PathBuf,
},
}Expand description
Top-level error type for the Jute compiler and code generator.
JuteError represents all possible failures that can occur during:
- Lexing
- Parsing
- Dependency resolution
- Type validation
- Code generation
- I/O operations
This enum is marked as
#[non_exhaustive]to allow adding new error variants in the future without breaking downstream code. Consumers should match using a wildcard arm (_) to remain forward-compatible.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
InvalidConversionToPremitive
An invalid conversion was attempted from a token to a primitive type. This usually indicates a invalid token where permetive type was excepted
UnexpectedToken
An unexpected token was encountered during parsing. This typically means the input does not conform to the Jute grammar.
Fields
UnexpectedChar
An unexpected character was encountered during lexing.
UnexpectedEndOfTokenStream
This usually indicates malformed or truncated input.
UnexpectedEndOfFile
The end of the source file was reached unexpectedly. Common causes include missing braces or incomplete declarations.
PathCanonicalizeError
Failed to canonicalize a filesystem path.
This can occur when resolving include paths or source file locations.
UnTerminatedMultiLineComment
A multiline comment (/* ... */) was not properly terminated.
UnTerminatedQuotedString
A quoted string literal was not properly terminated.
QuotedStringWithNewLineCharacter
A quoted string literal contains a newline character,
UnknownType
A referenced type could not be resolved. Provides detailed context to help diagnose schema issues.
Fields
AmbiguousType
This usually happens when two included modules define the same type name.
Fields
CircularDependency
A circular dependency was detected between modules.
The cycle field describes the dependency loop.
Io(Error)
Wrapper around std::io::Error.
Used for filesystem and I/O related failures.
Fmt(Error)
Wrapper around std::fmt::Error.
Typically occurs during code generation.
Utf8(FromUtf8Error)
Wrapper around UTF-8 decoding errors.
DuplicateModuleName
Duplicate module names detected across source files.
Fields
DuplicateClassName
Duplicate class names detected within the same module.
Fields
DuplicateFieldName
Duplicate field names detected within a class.
Fields
InvalidFieldType
An invalid field type was used in a class definition.