[][src]Trait libslide::parser::Parser

trait Parser<T> where
    T: Grammar,
    Self::Expr: RcExpression
{ type Expr; fn input(&mut self) -> &mut PeekIter<Token>

Notable traits for PeekIter<T>

impl<T> Iterator for PeekIter<T> where
    T: Clone
type Item = T;
;
fn parse(&mut self) -> T;
fn parse_float(&mut self, f: f64, span: Span) -> Self::Expr;
fn parse_variable(&mut self, name: String, span: Span) -> Self::Expr;
fn parse_var_pattern(&mut self, name: String, span: Span) -> Self::Expr;
fn parse_const_pattern(&mut self, name: String, span: Span) -> Self::Expr;
fn parse_any_pattern(&mut self, name: String, span: Span) -> Self::Expr;
fn push_diag(&mut self, diagnostic: Diagnostic);
fn has_stmt_break(&mut self) -> bool; fn parse_open_paren(&mut self, open: Token) -> Self::Expr { ... }
fn parse_open_bracket(&mut self, open: Token) -> Self::Expr { ... }
fn done(&mut self) -> bool { ... }
fn expr(&mut self) -> Self::Expr { ... }
fn peek(&mut self) -> &Token { ... }
fn next(&mut self) -> Token { ... }
fn add_sub_term(&mut self) -> Self::Expr { ... }
fn mul_divide_mod_term(&mut self) -> Self::Expr { ... }
fn exp_term(&mut self) -> Self::Expr { ... }
fn num_term(&mut self) -> Self::Expr { ... }
fn extra_tokens_diag(
        &mut self,
        additional_diags: impl Fn(Diagnostic, Span) -> Diagnostic
    ) { ... } }

Associated Types

type Expr

Loading content...

Required methods

fn input(&mut self) -> &mut PeekIter<Token>

Notable traits for PeekIter<T>

impl<T> Iterator for PeekIter<T> where
    T: Clone
type Item = T;

fn parse(&mut self) -> T

fn parse_float(&mut self, f: f64, span: Span) -> Self::Expr

fn parse_variable(&mut self, name: String, span: Span) -> Self::Expr

fn parse_var_pattern(&mut self, name: String, span: Span) -> Self::Expr

fn parse_const_pattern(&mut self, name: String, span: Span) -> Self::Expr

fn parse_any_pattern(&mut self, name: String, span: Span) -> Self::Expr

fn push_diag(&mut self, diagnostic: Diagnostic)

fn has_stmt_break(&mut self) -> bool

Loading content...

Provided methods

fn parse_open_paren(&mut self, open: Token) -> Self::Expr

fn parse_open_bracket(&mut self, open: Token) -> Self::Expr

fn done(&mut self) -> bool

fn expr(&mut self) -> Self::Expr

fn peek(&mut self) -> &Token

fn next(&mut self) -> Token

fn add_sub_term(&mut self) -> Self::Expr

fn mul_divide_mod_term(&mut self) -> Self::Expr

fn exp_term(&mut self) -> Self::Expr

fn num_term(&mut self) -> Self::Expr

fn extra_tokens_diag(
    &mut self,
    additional_diags: impl Fn(Diagnostic, Span) -> Diagnostic
)

Creates diagnostics for extra tokens following a primary item. All remaining tokens will be consumed in the construction of the diagnostic.

additional_diags applies additional diagnostic messages to the extra tokens diagnostic, if one is produced.

Loading content...

Implementors

impl Parser<RcExprPat> for ExpressionPatternParser[src]

type Expr = RcExprPat

impl<'a> Parser<StmtList> for ExpressionParser<'a>[src]

type Expr = RcExpr

fn has_stmt_break(&mut self) -> bool[src]

Do we have another statement (on a newline)?

Loading content...