Skip to content

Commit 50c451e

Browse files
allow for errors to not halt parsing
1 parent a4b6742 commit 50c451e

8 files changed

+135
-111
lines changed

crates/djls-template-ast/src/ast.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -136,20 +136,20 @@ pub type Attributes = BTreeMap<String, AttributeValue>;
136136
pub enum AstError {
137137
#[error("Empty AST")]
138138
EmptyAst,
139-
#[error("Stream error: {0}")]
140-
StreamError(String),
141-
#[error("Unclosed tag: {0}")]
139+
#[error("Empty tag")]
140+
EmptyTag,
141+
#[error("unclosed tag: {0}")]
142142
UnclosedTag(String),
143-
#[error("Unexpected tag: {0}")]
143+
#[error("unexpected tag: {0}")]
144144
UnexpectedTag(String),
145-
#[error("Invalid tag: {0}")]
145+
#[error("invalid tag: {0}")]
146146
InvalidTag(String),
147-
#[error("Block error: {0} in {1}")]
147+
#[error("block error: {0} in {1}")]
148148
BlockError(String, String),
149-
#[error("Argument error: {0} - {1}")]
149+
#[error("stream error: {0}")]
150+
StreamError(String),
151+
#[error("token error: {0}")]
152+
TokenError(String),
153+
#[error("argument error: {0} - {1}")]
150154
ArgumentError(String, String),
151-
#[error("Unexpected token")]
152-
UnexpectedToken,
153-
#[error("Unexpected end of file")]
154-
UnexpectedEof,
155155
}

0 commit comments

Comments
 (0)