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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/*!
<a href="https://github.com/Nercury/twig-rs">
    <img style="position: absolute; top: 0; left: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_left_green_007200.png" alt="Fork me on GitHub">
</a>
<style>.sidebar { margin-top: 53px }</style>
*/

/**
 * This module is part of twig-rs.
 *
 * (c) 2015 Rust Twig Team
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

extern crate regex;

mod token;
mod lexer;
mod error;
mod environment;

pub mod extension;
pub mod node;
pub mod parser;
pub mod operator;
pub mod value;
pub mod runtime;

pub use error::{ Error, Result };
pub use lexer::{ Lexer };
pub use lexer::iter::TokenIter;
pub use environment::{ CompiledEnvironment, Environment };
pub use token::Token;
pub use token::Value as TokenValue;

/// Returns different output based on expected value.
pub trait Expect<V> {
    type Output;

    fn expect(&mut self, expected: V) -> Self::Output;
}