-
-
Notifications
You must be signed in to change notification settings - Fork 120
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
51 changed files
with
606 additions
and
450 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,37 @@ | ||
//! Error results that can be returned from the css3 parser | ||
use gosub_shared::byte_stream::Location; | ||
use thiserror::Error; | ||
// use gosub_shared::byte_stream::Location; | ||
|
||
/// Parser error that defines an error (message) on the given position | ||
#[derive(Clone, Debug, PartialEq)] | ||
pub struct ParseError { | ||
/// Error message | ||
pub message: String, | ||
/// Location of the error | ||
pub location: Location, | ||
} | ||
|
||
/// Serious errors and errors from third-party libraries | ||
#[derive(Debug, Error)] | ||
pub enum Error { | ||
#[error("parse error: {0} at {1}")] | ||
Parse(String, Location), | ||
|
||
#[allow(dead_code)] | ||
#[error("incorrect value: {0} at {1}")] | ||
IncorrectValue(String, Location), | ||
// | ||
// /// Parser error that defines an error (message) on the given position | ||
// #[derive(Clone, Debug, PartialEq)] | ||
// pub struct CssError { | ||
// /// Error message | ||
// pub message: String, | ||
// /// Location of the error, if available (during parsing mostly) | ||
// pub location: Option<Location>, | ||
// } | ||
// | ||
// impl CssError { | ||
// pub fn new(message: &str, location: Option<Location>) -> Self { | ||
// Self { | ||
// message: message.to_string(), | ||
// location, | ||
// } | ||
// } | ||
// } | ||
|
||
#[error("css failure: {0}")] | ||
CssFailure(String), | ||
} | ||
// /// Serious errors and errors from third-party libraries | ||
// #[derive(Debug, Error)] | ||
// pub enum Error { | ||
// #[error("parse error: {0} at {1}")] | ||
// Parse(String, Location), | ||
// | ||
// #[allow(dead_code)] | ||
// #[error("incorrect value: {0} at {1}")] | ||
// IncorrectValue(String, Location), | ||
// | ||
// #[error("css failure: {0}")] | ||
// CssFailure(String), | ||
// } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.