Struct css_module_lexer::Lexer

source ·
pub struct Lexer<'s, I: Iterator<Item = char> = Chars<'s>> { /* private fields */ }

Implementations§

source§

impl<'s> Lexer<'s>

source

pub fn new(value: &'s str) -> Self

source

pub fn turn_back(self, end: Pos) -> Lexer<'s, Rev<Chars<'s>>>

source

pub fn slice(&self, start: Pos, end: Pos) -> Option<&'s str>

source

pub fn slice_range<'a>(input: &'a str, range: &Range) -> Option<&'a str>

source§

impl<'s, I: Iterator<Item = char>> Lexer<'s, I>

source

pub fn consume(&mut self)

source

pub fn cur_pos(&self) -> Option<Pos>

source

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

source

pub fn peek_pos(&self) -> Option<Pos>

source

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

source

pub fn peek2_pos(&self) -> Option<Pos>

source

pub fn peek2(&self) -> Option<char>

source§

impl<'s> Lexer<'s>

source

pub fn lex<T: Visitor<'s>>(&mut self, visitor: &mut T)

source

pub fn consume_delim(&mut self)

source

pub fn consume_numeric_token(&mut self) -> Option<()>

source

pub fn consume_number(&mut self) -> Option<()>

source

pub fn consume_ident_sequence(&mut self) -> Option<()>

source

pub fn consume_escaped(&mut self) -> Option<()>

source

pub fn consume_ident_like<T: Visitor<'s>>( &mut self, visitor: &mut T, ) -> Option<()>

source

pub fn consume_url<T: Visitor<'s>>( self: &mut Lexer<'s>, visitor: &mut T, start: Pos, ) -> Option<()>

source

pub fn consume_string<T: Visitor<'s>>( &mut self, visitor: &mut T, end: char, ) -> Option<()>

source

pub fn consume_number_sign<T: Visitor<'s>>( &mut self, visitor: &mut T, ) -> Option<()>

source

pub fn consume_left_parenthesis<T: Visitor<'s>>( &mut self, visitor: &mut T, ) -> Option<()>

source

pub fn consume_right_parenthesis<T: Visitor<'s>>( &mut self, visitor: &mut T, ) -> Option<()>

source

pub fn consume_plus_sign(&mut self) -> Option<()>

source

pub fn consume_comma<T: Visitor<'s>>(&mut self, visitor: &mut T) -> Option<()>

source

pub fn consume_minus<T: Visitor<'s>>(&mut self, visitor: &mut T) -> Option<()>

source

pub fn consume_full_stop<T: Visitor<'s>>( &mut self, visitor: &mut T, ) -> Option<()>

source

pub fn consume_potential_pseudo<T: Visitor<'s>>( &mut self, visitor: &mut T, ) -> Option<()>

source

pub fn consume_semicolon<T: Visitor<'s>>( &mut self, visitor: &mut T, ) -> Option<()>

source

pub fn consume_less_than_sign(&mut self) -> Option<()>

source

pub fn consume_at_sign<T: Visitor<'s>>(&mut self, visitor: &mut T) -> Option<()>

source

pub fn consume_reverse_solidus<T: Visitor<'s>>( &mut self, visitor: &mut T, ) -> Option<()>

source

pub fn consume_left_curly<T: Visitor<'s>>( &mut self, visitor: &mut T, ) -> Option<()>

source

pub fn consume_right_curly<T: Visitor<'s>>( &mut self, visitor: &mut T, ) -> Option<()>

source§

impl<'s, I: Iterator<Item = char>> Lexer<'s, I>

source

pub fn consume_comments(&mut self) -> Option<()>

source

pub fn consume_space(&mut self) -> Option<()>

source

pub fn consume_white_space_and_comments(&mut self) -> Option<()>

Trait Implementations§

source§

impl<'s, I: Clone + Iterator<Item = char>> Clone for Lexer<'s, I>

source§

fn clone(&self) -> Lexer<'s, I>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<'s, I: Debug + Iterator<Item = char>> Debug for Lexer<'s, I>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'s, I> Freeze for Lexer<'s, I>
where I: Freeze,

§

impl<'s, I> RefUnwindSafe for Lexer<'s, I>
where I: RefUnwindSafe,

§

impl<'s, I> Send for Lexer<'s, I>
where I: Send,

§

impl<'s, I> Sync for Lexer<'s, I>
where I: Sync,

§

impl<'s, I> Unpin for Lexer<'s, I>
where I: Unpin,

§

impl<'s, I> UnwindSafe for Lexer<'s, I>
where I: UnwindSafe,

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> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

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

§

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>,

§

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.