Struct Parser

Source
pub struct Parser {
    pub current: Option<Token>,
    /* private fields */
}

Fields§

§current: Option<Token>

Implementations§

Source§

impl Parser

Source

pub fn new(source: &str) -> Self

Source

pub fn parse(&mut self) -> ParseResult<Node>

Source

pub fn parse_with_recovery(&mut self) -> (Option<Node>, Vec<ParserError>)

Source

pub fn parse_block_statement(&mut self) -> ParseResult<Node>

Source

pub fn parse_expression(&mut self) -> ParseResult<Node>

Source

pub fn parse_equality_expression(&mut self) -> ParseResult<Node>

Source

pub fn parse_primary_expression(&mut self) -> ParseResult<Node>

Source

pub fn parse_parameters(&mut self) -> ParseResult<Vec<Node>>

Source

pub fn parse_arguments(&mut self) -> ParseResult<Vec<Node>>

Source

pub fn parse_function_body(&mut self) -> ParseResult<Node>

Source

pub fn parse_class_body(&mut self) -> ParseResult<Node>

Source

pub fn parse_identifier(&mut self) -> ParseResult<Node>

Source

pub fn current_token_string(&self) -> String

Source

pub fn check(&self, token_kind: TokenKind) -> bool

Source

pub fn check_identifier(&self) -> bool

Source

pub fn expect(&mut self, token_kind: TokenKind) -> ParseResult<()>

Source

pub fn advance(&mut self)

Source

pub fn is_eof(&self) -> bool

Source

pub fn current_position(&self) -> Option<Position>

Source

pub fn create_span_from_tokens(&self) -> Span

Source

pub fn is_assignment_operator(&self) -> bool

Source

pub fn is_relational_operator(&self) -> bool

Source

pub fn is_shift_operator(&self) -> bool

Source

pub fn is_additive_operator(&self) -> bool

Source

pub fn is_multiplicative_operator(&self) -> bool

Source

pub fn is_exponentiation_operator(&self) -> bool

Source

pub fn is_unary_operator(&self) -> bool

Source

pub fn parse_destructuring_pattern(&mut self) -> ParseResult<Node>

Source§

impl Parser

Source§

impl Parser

Source§

impl Parser

Source§

impl Parser

Source§

impl Parser

Source§

impl Parser

Source§

impl Parser

Source§

impl Parser

Source§

impl Parser

Source§

impl Parser

Source§

impl Parser

Source§

impl Parser

Source§

impl Parser

Source§

impl Parser

Source§

impl Parser

Auto Trait Implementations§

§

impl Freeze for Parser

§

impl RefUnwindSafe for Parser

§

impl Send for Parser

§

impl Sync for Parser

§

impl Unpin for Parser

§

impl UnwindSafe for Parser

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.