mage 0.2.0

An intuitive and powerful template engine.
Documentation

use std::io::Error as IOError;
use ExpressionError;


quick_error! {
    #[derive(Debug)]
/// Template parsing error
    pub enum Error {
/// Unpaired brackets. you may have symtax like {{ {{ , if you really want that, you should write \{{ \{{
        UnpairedBrackets {
            display(r#"Unpaired brackets. you may have symtax like {{ {{ , if you really want that, you should write \{{ \{{"#)
        }
/// Expect `if` keyword but the given isn't.
        ExpectIf {
            display("Expect `if` keyword but the given isn't.")
        }
/// Can not close this node.
        CanNotClose {
            display("Can not close this node.")
        }
/// Found unexpected node.
        UnexpectedNode {
            display("Found unexpected node.")
        }
/// IO Error.
        Io(error: IOError) {
            from()
        }
/// Expression error.
        Expression(error: ExpressionError) {
            from()
        }
/// Can not render.
        CanNotRender {
            display("Can not render this node.")
        }
/// Expect array or object but the given isn't.
        ExpectArrayOrObject {
            display("Expect array or object but the given isn't.")
        }
/// Expect boolean but the given isn't.
        ExpectedBoolean {
            display("Expect boolean but the given isn't.")
        }
/// Invalid `set` block.
        InvalidSetBlock {
            display("Invalid `set` block.")
        }
/// Invalid `for` block
        InvalidForBlock {
            display("Invalid `for` block")
        }
    }
}