Struct js::syntax::lexer::Lexer[src]

pub struct Lexer<B> {
    pub tokens: Vec<Token>,
    // some fields omitted
}

A Javascript lexer

Fields

tokens

The list of tokens generated so far

Methods

impl<B: Buffer> Lexer<B>

fn new(buffer: B) -> Lexer<B>

Creates a new lexer with empty buffers

fn lex_str(script: &str) -> Vec<Token>

Processes an input stream from a string into an array of tokens

fn lex(&mut self) -> IoResult<()>

Processes an input stream from the buffer into a vector of tokens