[][src]Trait swc_ecma_parser::Input

pub trait Input: Clone {
    fn cur(&mut self) -> Option<char>;
fn peek(&mut self) -> Option<char>;
fn peek_ahead(&mut self) -> Option<char>;
fn bump(&mut self);
fn is_at_start(&self) -> bool;
fn cur_pos(&mut self) -> BytePos;
fn last_pos(&self) -> BytePos;
fn slice(&mut self, start: BytePos, end: BytePos) -> &str;
fn uncons_while<F>(&mut self, f: F) -> &str
    where
        F: FnMut(char) -> bool
;
fn find<F>(&mut self, f: F) -> Option<BytePos>
    where
        F: FnMut(char) -> bool
;
fn reset_to(&mut self, to: BytePos); }

Required methods

fn cur(&mut self) -> Option<char>

fn peek(&mut self) -> Option<char>

fn peek_ahead(&mut self) -> Option<char>

fn bump(&mut self)

fn is_at_start(&self) -> bool

fn cur_pos(&mut self) -> BytePos

fn last_pos(&self) -> BytePos

fn slice(&mut self, start: BytePos, end: BytePos) -> &str

fn uncons_while<F>(&mut self, f: F) -> &str where
    F: FnMut(char) -> bool

Takes items from stream, testing each one with predicate. returns the range of items which passed predicate.

fn find<F>(&mut self, f: F) -> Option<BytePos> where
    F: FnMut(char) -> bool

This method modifies [last_pos()] and [cur_pos()].

fn reset_to(&mut self, to: BytePos)

Loading content...

Implementors

impl<'a> Input for SourceFileInput<'a>[src]

Loading content...