[][src]Struct ecmascript::parser::Parser

pub struct Parser<'ast> {
    pub token: Vec<Token<'ast>>,
    pub body: Vec<Statement<'ast>>,
    pub tokens: Vec<Token<'ast>>,
    pub errors: Vec<Error>,
    // some fields omitted
}

Fields

token: Vec<Token<'ast>>body: Vec<Statement<'ast>>tokens: Vec<Token<'ast>>errors: Vec<Error>

Methods

impl<'ast> Parser<'ast>[src]

pub fn new(
    arena: &'ast Arena,
    source: &'ast [char],
    filename: &'ast str
) -> Self
[src]

pub fn error(&mut self) -> Error[src]

pub fn error_line(&mut self) -> String[src]

pub fn unexpected_token(&mut self, token: Token<'ast>) -> Error[src]

pub fn unexpected_eof(&mut self) -> Error[src]

pub fn token(&mut self) -> Result<Option<Token<'ast>>, Error>[src]

pub fn token2(&mut self) -> Result<Token<'ast>, Error>[src]

pub fn token3(&mut self) -> Result<Token<'ast>, Error>[src]

pub fn token4(&mut self) -> Result<Token<'ast>, Error>[src]

pub fn alloc<T: Copy>(&mut self, item: T) -> &'ast T[src]

pub fn process(&mut self, token: Token<'ast>) -> Result<Statement<'ast>, Error>[src]

pub fn parse(&mut self) -> Result<(), Error>[src]

impl<'ast> Parser<'ast>[src]

pub fn parse_expression(
    &mut self,
    token: Token<'ast>,
    precedence: i8
) -> Result<Expression<'ast>, Error>
[src]

pub fn parse_member_expression(
    &mut self,
    left_expr: Expression<'ast>,
    token: Token<'ast>
) -> Result<Expression<'ast>, Error>
[src]

pub fn parse_new_expression(
    &mut self,
    token: Token<'ast>
) -> Result<Expression<'ast>, Error>
[src]

pub fn parse_object_binding_pattern(
    &mut self
) -> Result<Expression<'ast>, Error>
[src]

pub fn parse_array_binding_pattern(&mut self) -> Result<Expression<'ast>, Error>[src]

pub fn parse_brace_expression(
    &mut self,
    token: Token<'ast>
) -> Result<Expression<'ast>, Error>
[src]

pub fn parse_bracket_expression(
    &mut self,
    token: Token<'ast>
) -> Result<Expression<'ast>, Error>
[src]

impl<'ast> Parser<'ast>[src]

pub fn parse_statement(
    &mut self,
    token: Token<'ast>
) -> Result<Statement<'ast>, Error>
[src]

pub fn parse_variable_statement(
    &mut self,
    token: Token<'ast>
) -> Result<Statement<'ast>, Error>
[src]

var/let/const

pub fn parse_async_statement(
    &mut self,
    token: Token<'ast>
) -> Result<Statement<'ast>, Error>
[src]

pub fn parse_block_statement(
    &mut self,
    token: Token<'ast>
) -> Result<BlockStatement<'ast>, Error>
[src]

impl<'ast> Parser<'ast>[src]

pub fn parse_class(&mut self, token: Token<'ast>) -> Result<Class<'ast>, Error>[src]

pub fn parse_class_declaration(
    &mut self,
    token: Token<'ast>
) -> Result<ClassDeclaration<'ast>, Error>
[src]

pub fn parse_class_expression(
    &mut self,
    token: Token<'ast>
) -> Result<ClassExpression<'ast>, Error>
[src]

pub fn parse_class_element(
    &mut self,
    token: Token<'ast>
) -> Result<ClassMethodDefinition<'ast>, Error>
[src]

pub fn parse_method_definition(
    &mut self,
    token: Token<'ast>
) -> Result<MethodDefinition<'ast>, Error>
[src]

impl<'ast> Parser<'ast>[src]

pub fn parse_function(
    &mut self,
    token: Token<'ast>
) -> Result<Function<'ast>, Error>
[src]

pub fn parse_function_declaration(
    &mut self,
    token: Token<'ast>
) -> Result<FunctionDeclaration<'ast>, Error>
[src]

pub fn parse_function_expression(
    &mut self,
    token: Token<'ast>
) -> Result<FunctionExpression<'ast>, Error>
[src]

pub fn parse_async_expression(
    &mut self,
    token: Token<'ast>
) -> Result<Expression<'ast>, Error>
[src]

pub fn parse_arrow_function_expression(
    &mut self,
    params: Expression<'ast>
) -> Result<Expression<'ast>, Error>
[src]

impl<'ast> Parser<'ast>[src]

pub fn parse_object(
    &mut self,
    token: Token<'ast>
) -> Result<Expression<'ast>, Error>
[src]

pub fn parse_array(
    &mut self,
    token: Token<'ast>
) -> Result<Expression<'ast>, Error>
[src]

Auto Trait Implementations

impl<'ast> !Send for Parser<'ast>

impl<'ast> !Sync for Parser<'ast>

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]