Skip to main content

hpx_browser/css_parser/
error.rs

1use crate::css_parser::source::SourceLocation;
2
3/// A CSS parse error. CSS parsing is error-tolerant.
4#[derive(Debug, Clone, thiserror::Error)]
5pub enum ParseError {
6    #[error("unexpected token at {loc:?}: expected {expected}, found {found}")]
7    UnexpectedToken {
8        loc: SourceLocation,
9        expected: String,
10        found: String,
11    },
12
13    #[error("unexpected end of input at {loc:?}")]
14    UnexpectedEof { loc: SourceLocation },
15
16    #[error("invalid CSS at {loc:?}: {message}")]
17    Invalid {
18        loc: SourceLocation,
19        message: String,
20    },
21}