Struct twig::tokens::Lexer [] [src]

pub struct Lexer {
    // some fields omitted
}

Parses template file and converts it to a stream of tokens.

Methods

impl Lexer

fn new(options: LexerOptions, operators: &HashSet<&'static str>) -> Lexer

Creates a new lexer with specified options and operator list.

fn default(env: &LexingEnvironment) -> Lexer

Initialize default lexer with default options.

fn tokens<'r, 'code>(&'r self, code: &'code str) -> TokenIter<'r, 'code>

Convert provided template into a token stream.