1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#[derive(Debug)]
pub enum ParseErrorKind {
    // <each-node>...</each-node>
    // <each-field>...</each-field>
    MissingLoopClosingTag,
    MissingLoopBody,

    // <helper ...>
    MissingHelperName,
    MissingHelperClose,

    // <if ...> ... <else> ... </if>
    MissingPredicateInCondition,
    MissingIfTrueBody,
    MissingElse,
    MissingIfFalseBody,
    MissingIfClosingTag,

    UnexpectedEof,
}

#[derive(Debug)]
pub struct ParseError {
    pub kind: ParseErrorKind,
    pub pos: usize,
}