[][src]Struct libslide::scanner::Scanner

struct Scanner {
    pos: usize,
    input: Vec<char>,
    leading_trivia_start: usize,
    pub output: Vec<Token>,
    pub diagnostics: Vec<Diagnostic>,
}

Fields

pos: usizeinput: Vec<char>leading_trivia_start: usizeoutput: Vec<Token>diagnostics: Vec<Diagnostic>

Implementations

impl Scanner[src]

pub fn new(input: &str) -> Scanner[src]

Instantiate a new scanner.

fn peek(&self) -> Option<&char>[src]

fn next(&mut self) -> Option<&char>[src]

fn push_diag(&mut self, diagnostic: Diagnostic)[src]

fn push_tok<S: Into<Span>>(&mut self, ty: TokenType, span: S)[src]

fn collect_while(&mut self, pred: fn(_: &char) -> bool) -> String[src]

pub fn scan(&mut self)[src]

fn scan_trivia(&mut self)[src]

Scans leading trivia, including whitespace.

fn scan_symbol(&mut self)[src]

Matches a symbol with a token and creates it.

fn scan_num(&mut self)[src]

Scans through the content of a number to create a token of that value.

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

fn scan_var(&mut self)[src]

fn scan_var_pattern(&mut self)[src]

fn scan_const_pattern(&mut self)[src]

fn scan_any_pattern(&mut self)[src]

Auto Trait Implementations

impl RefUnwindSafe for Scanner

impl Send for Scanner

impl Sync for Scanner

impl Unpin for Scanner

impl UnwindSafe for Scanner

Blanket Implementations

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

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

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

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.