[−][src]Struct ecmascript::parser::Parser
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]
arena: &'ast Arena,
source: &'ast [char],
filename: &'ast str
) -> Self
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]
&mut self,
token: Token<'ast>,
precedence: i8
) -> Result<Expression<'ast>, Error>
pub fn parse_member_expression(
&mut self,
left_expr: Expression<'ast>,
token: Token<'ast>
) -> Result<Expression<'ast>, Error>
[src]
&mut self,
left_expr: Expression<'ast>,
token: Token<'ast>
) -> Result<Expression<'ast>, Error>
pub fn parse_new_expression(
&mut self,
token: Token<'ast>
) -> Result<Expression<'ast>, Error>
[src]
&mut self,
token: Token<'ast>
) -> Result<Expression<'ast>, Error>
pub fn parse_object_binding_pattern(
&mut self
) -> Result<Expression<'ast>, Error>
[src]
&mut self
) -> Result<Expression<'ast>, Error>
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]
&mut self,
token: Token<'ast>
) -> Result<Expression<'ast>, Error>
pub fn parse_bracket_expression(
&mut self,
token: Token<'ast>
) -> Result<Expression<'ast>, Error>
[src]
&mut self,
token: Token<'ast>
) -> Result<Expression<'ast>, Error>
impl<'ast> Parser<'ast>
[src]
pub fn parse_statement(
&mut self,
token: Token<'ast>
) -> Result<Statement<'ast>, Error>
[src]
&mut self,
token: Token<'ast>
) -> Result<Statement<'ast>, Error>
pub fn parse_variable_statement(
&mut self,
token: Token<'ast>
) -> Result<Statement<'ast>, Error>
[src]
&mut self,
token: Token<'ast>
) -> Result<Statement<'ast>, Error>
var/let/const
pub fn parse_async_statement(
&mut self,
token: Token<'ast>
) -> Result<Statement<'ast>, Error>
[src]
&mut self,
token: Token<'ast>
) -> Result<Statement<'ast>, Error>
pub fn parse_block_statement(
&mut self,
token: Token<'ast>
) -> Result<BlockStatement<'ast>, Error>
[src]
&mut self,
token: Token<'ast>
) -> Result<BlockStatement<'ast>, Error>
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]
&mut self,
token: Token<'ast>
) -> Result<ClassDeclaration<'ast>, Error>
pub fn parse_class_expression(
&mut self,
token: Token<'ast>
) -> Result<ClassExpression<'ast>, Error>
[src]
&mut self,
token: Token<'ast>
) -> Result<ClassExpression<'ast>, Error>
pub fn parse_class_element(
&mut self,
token: Token<'ast>
) -> Result<ClassMethodDefinition<'ast>, Error>
[src]
&mut self,
token: Token<'ast>
) -> Result<ClassMethodDefinition<'ast>, Error>
pub fn parse_method_definition(
&mut self,
token: Token<'ast>
) -> Result<MethodDefinition<'ast>, Error>
[src]
&mut self,
token: Token<'ast>
) -> Result<MethodDefinition<'ast>, Error>
impl<'ast> Parser<'ast>
[src]
pub fn parse_function(
&mut self,
token: Token<'ast>
) -> Result<Function<'ast>, Error>
[src]
&mut self,
token: Token<'ast>
) -> Result<Function<'ast>, Error>
pub fn parse_function_declaration(
&mut self,
token: Token<'ast>
) -> Result<FunctionDeclaration<'ast>, Error>
[src]
&mut self,
token: Token<'ast>
) -> Result<FunctionDeclaration<'ast>, Error>
pub fn parse_function_expression(
&mut self,
token: Token<'ast>
) -> Result<FunctionExpression<'ast>, Error>
[src]
&mut self,
token: Token<'ast>
) -> Result<FunctionExpression<'ast>, Error>
pub fn parse_async_expression(
&mut self,
token: Token<'ast>
) -> Result<Expression<'ast>, Error>
[src]
&mut self,
token: Token<'ast>
) -> Result<Expression<'ast>, Error>
pub fn parse_arrow_function_expression(
&mut self,
params: Expression<'ast>
) -> Result<Expression<'ast>, Error>
[src]
&mut self,
params: Expression<'ast>
) -> Result<Expression<'ast>, Error>
impl<'ast> Parser<'ast>
[src]
pub fn parse_object(
&mut self,
token: Token<'ast>
) -> Result<Expression<'ast>, Error>
[src]
&mut self,
token: Token<'ast>
) -> Result<Expression<'ast>, Error>
pub fn parse_array(
&mut self,
token: Token<'ast>
) -> Result<Expression<'ast>, Error>
[src]
&mut self,
token: Token<'ast>
) -> Result<Expression<'ast>, Error>
Auto Trait Implementations
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,