mirror of
https://codeberg.org/icewind/php-literal-parser.git
synced 2026-06-03 18:44:07 +02:00
clonable errors
This commit is contained in:
parent
8c8b1a6904
commit
ba0b66e1bb
2 changed files with 4 additions and 4 deletions
|
|
@ -28,7 +28,7 @@ use thiserror::Error;
|
|||
/// 6 |
|
||||
/// ```
|
||||
///
|
||||
#[derive(Debug)]
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct ParseError {
|
||||
span: Option<Span>,
|
||||
error: RawParseError,
|
||||
|
|
@ -148,7 +148,7 @@ fn get_position(text: &str, index: usize) -> Position {
|
|||
pos
|
||||
}
|
||||
|
||||
#[derive(Error, Debug)]
|
||||
#[derive(Error, Debug, Clone)]
|
||||
pub enum RawParseError {
|
||||
#[error("{0}")]
|
||||
UnexpectedToken(#[from] UnexpectedTokenError),
|
||||
|
|
@ -183,7 +183,7 @@ impl From<UnescapeError> for RawParseError {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct UnexpectedTokenError {
|
||||
pub expected: Vec<Token>,
|
||||
pub found: Option<Token>,
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
use thiserror::Error;
|
||||
|
||||
#[derive(Debug, Error)]
|
||||
#[derive(Debug, Error, Clone)]
|
||||
pub enum ParseIntError {
|
||||
#[error("cannot parse integer from empty string")]
|
||||
Empty,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue