Struct ress::ManualScanner[][src]

pub struct ManualScanner<'a> {
    pub stream: Tokenizer<'a>,
    pub eof: bool,
    pub pending_new_line: bool,
    pub last_skipped_whitespace: usize,
    pub new_line_count: usize,
    // some fields omitted
}

Fields

stream: Tokenizer<'a>eof: boolpending_new_line: boollast_skipped_whitespace: usizenew_line_count: usize

Implementations

impl<'b> ManualScanner<'b>[src]

pub fn new(text: &'b str) -> Self[src]

pub fn skip_comments(&mut self) -> Result<(), Error>[src]

Skip any upcoming comments to get the next valid js token

pub fn get_state(&self) -> ScannerState[src]

Get a copy of the scanner’s current state

pub fn set_state(&mut self, state: ScannerState)[src]

Set the scanner’s current state to the state provided

pub fn next_token(&mut self) -> Option<Result<Item<&'b str>, Error>>[src]

pub fn next_regex(
    &mut self,
    prev_len: usize
) -> Option<Result<Item<&'b str>, Error>>
[src]

Get the next token as a regular expression. The previous token should have been / or /=,

pub fn string_for(&self, span: &Span) -> Option<String>[src]

Get a string for any given span

pub fn str_for(&self, span: &Span) -> Option<&'b str>[src]

Get a &str for any given span

pub fn position_for(&self, idx: usize) -> (usize, usize)[src]

Get the line/column pair for any given byte index

Auto Trait Implementations

impl<'a> RefUnwindSafe for ManualScanner<'a>

impl<'a> Send for ManualScanner<'a>

impl<'a> Sync for ManualScanner<'a>

impl<'a> Unpin for ManualScanner<'a>

impl<'a> UnwindSafe for ManualScanner<'a>

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.