pub struct OakError { /* private fields */ }Expand description
The main error type for the Oak Core parsing framework.
OakError represents all possible language that can occur during
lexical analysis and parsing operations. It provides detailed
error information including error kind and/// precise source location.
Implementations§
Source§impl OakError
impl OakError
Sourcepub fn test_failure(path: PathBuf, expected: String, actual: String) -> Self
pub fn test_failure(path: PathBuf, expected: String, actual: String) -> Self
Creates a test failure error.
Sourcepub fn test_regenerated(path: PathBuf) -> Self
pub fn test_regenerated(path: PathBuf) -> Self
Creates a test regenerated error.
Sourcepub fn unexpected_token(
token: impl Into<String>,
offset: usize,
url: Option<Url>,
) -> Self
pub fn unexpected_token( token: impl Into<String>, offset: usize, url: Option<Url>, ) -> Self
Creates an unexpected token error.
Sourcepub fn unexpected_eof(offset: usize, url: Option<Url>) -> Self
pub fn unexpected_eof(offset: usize, url: Option<Url>) -> Self
Creates an unexpected end of file error.
Sourcepub fn expected_token(
expected: impl Into<String>,
offset: usize,
url: Option<Url>,
) -> Self
pub fn expected_token( expected: impl Into<String>, offset: usize, url: Option<Url>, ) -> Self
Creates an expected token error.
Sourcepub fn expected_name(
name_kind: impl Into<String>,
offset: usize,
url: Option<Url>,
) -> Self
pub fn expected_name( name_kind: impl Into<String>, offset: usize, url: Option<Url>, ) -> Self
Creates an expected name error.
Sourcepub fn trailing_comma_not_allowed(offset: usize, url: Option<Url>) -> Self
pub fn trailing_comma_not_allowed(offset: usize, url: Option<Url>) -> Self
Creates a trailing comma not allowed error.
Sourcepub fn custom_error(message: impl Into<String>) -> Self
pub fn custom_error(message: impl Into<String>) -> Self
Sourcepub fn invalid_theme(message: impl Into<String>) -> Self
pub fn invalid_theme(message: impl Into<String>) -> Self
Creates an invalid theme error.
Sourcepub fn unsupported_format(format: impl Into<String>) -> Self
pub fn unsupported_format(format: impl Into<String>) -> Self
Creates an unsupported format error.
Sourcepub fn color_parse_error(color: impl Into<String>) -> Self
pub fn color_parse_error(color: impl Into<String>) -> Self
Creates a color parsing error.
Sourcepub fn format_error(message: impl Into<String>) -> Self
pub fn format_error(message: impl Into<String>) -> Self
Creates a formatting error.
Sourcepub fn semantic_error(message: impl Into<String>) -> Self
pub fn semantic_error(message: impl Into<String>) -> Self
Creates a semantic error.
Sourcepub fn protocol_error(message: impl Into<String>) -> Self
pub fn protocol_error(message: impl Into<String>) -> Self
Creates a protocol error.
Sourcepub fn kind(&self) -> &OakErrorKind
pub fn kind(&self) -> &OakErrorKind
Returns a reference to the error kind.
§Returns
A reference to the OakErrorKind enum that categorizes this error.