mirror of
https://codeberg.org/icewind/php-literal-parser.git
synced 2026-06-03 10:34:08 +02:00
fix error codes
This commit is contained in:
parent
bd3f415eae
commit
eef0d28907
1 changed files with 5 additions and 5 deletions
10
src/error.rs
10
src/error.rs
|
|
@ -29,7 +29,7 @@ pub enum ParseError {
|
||||||
/// Trailing characters after parsing
|
/// Trailing characters after parsing
|
||||||
TrailingCharacters(#[from] TrailingError),
|
TrailingCharacters(#[from] TrailingError),
|
||||||
#[error("{0}")]
|
#[error("{0}")]
|
||||||
#[diagnostic(code(php_object_parser::serde))]
|
#[diagnostic(code(php_literal_parser::serde))]
|
||||||
/// Error while populating serde type
|
/// Error while populating serde type
|
||||||
Serde(String),
|
Serde(String),
|
||||||
}
|
}
|
||||||
|
|
@ -45,7 +45,7 @@ impl serde::de::Error for ParseError {
|
||||||
|
|
||||||
/// A token that wasn't expected was found while parsing
|
/// A token that wasn't expected was found while parsing
|
||||||
#[derive(Debug, Clone, Diagnostic)]
|
#[derive(Debug, Clone, Diagnostic)]
|
||||||
#[diagnostic(code(php_object_parser::unexpected_token))]
|
#[diagnostic(code(php_literal_parser::unexpected_token))]
|
||||||
pub struct UnexpectedTokenError {
|
pub struct UnexpectedTokenError {
|
||||||
src: String,
|
src: String,
|
||||||
#[snippet(src)]
|
#[snippet(src)]
|
||||||
|
|
@ -134,7 +134,7 @@ impl Error for UnexpectedTokenError {}
|
||||||
|
|
||||||
/// A malformed integer, float, boolean or string literal was found
|
/// A malformed integer, float, boolean or string literal was found
|
||||||
#[derive(Debug, Clone, Error, Diagnostic)]
|
#[derive(Debug, Clone, Error, Diagnostic)]
|
||||||
#[diagnostic(code(php_object_parser::invalid_primitive))]
|
#[diagnostic(code(php_literal_parser::invalid_primitive))]
|
||||||
#[error("{kind}")]
|
#[error("{kind}")]
|
||||||
pub struct PrimitiveError {
|
pub struct PrimitiveError {
|
||||||
src: String,
|
src: String,
|
||||||
|
|
@ -175,7 +175,7 @@ impl From<UnescapeError> for PrimitiveErrorKind {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, Error, Diagnostic)]
|
#[derive(Debug, Clone, Error, Diagnostic)]
|
||||||
#[diagnostic(code(php_object_parser::invalid_array_key))]
|
#[diagnostic(code(php_literal_parser::invalid_array_key))]
|
||||||
#[error("Invalid array key")]
|
#[error("Invalid array key")]
|
||||||
pub struct ArrayKeyError {
|
pub struct ArrayKeyError {
|
||||||
src: String,
|
src: String,
|
||||||
|
|
@ -217,7 +217,7 @@ impl ArrayKeyError {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, Error, Diagnostic)]
|
#[derive(Debug, Clone, Error, Diagnostic)]
|
||||||
#[diagnostic(code(php_object_parser::trailing))]
|
#[diagnostic(code(php_literal_parser::trailing))]
|
||||||
#[error("Trailing characters after parsing")]
|
#[error("Trailing characters after parsing")]
|
||||||
pub struct TrailingError {
|
pub struct TrailingError {
|
||||||
src: String,
|
src: String,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue