pub struct TailwindLexer {
pub config: TailwindLanguage,
}Expand description
Lexer for the Tailwind language.
Fields§
§config: TailwindLanguageLanguage configuration
Implementations§
Source§impl TailwindLexer
impl TailwindLexer
Sourcepub fn new(config: TailwindLanguage) -> Self
pub fn new(config: TailwindLanguage) -> Self
Creates a new TailwindLexer with the given configuration.
Source§impl TailwindLexer
impl TailwindLexer
Sourcepub fn run<S: Source + ?Sized>(
&self,
state: &mut LexerState<'_, S, TailwindLanguage>,
) -> Result<(), OakError>
pub fn run<S: Source + ?Sized>( &self, state: &mut LexerState<'_, S, TailwindLanguage>, ) -> Result<(), OakError>
Runs the lexer logic.
Sourcepub fn skip_whitespace<S: Source + ?Sized>(
&self,
state: &mut LexerState<'_, S, TailwindLanguage>,
) -> bool
pub fn skip_whitespace<S: Source + ?Sized>( &self, state: &mut LexerState<'_, S, TailwindLanguage>, ) -> bool
Skips whitespace characters.
Sourcepub fn lex_comment<S: Source + ?Sized>(
&self,
state: &mut LexerState<'_, S, TailwindLanguage>,
) -> bool
pub fn lex_comment<S: Source + ?Sized>( &self, state: &mut LexerState<'_, S, TailwindLanguage>, ) -> bool
Lexes a comment.
Sourcepub fn lex_directive<S: Source + ?Sized>(
&self,
state: &mut LexerState<'_, S, TailwindLanguage>,
) -> bool
pub fn lex_directive<S: Source + ?Sized>( &self, state: &mut LexerState<'_, S, TailwindLanguage>, ) -> bool
Lexes a directive like @tailwind, @apply.
Sourcepub fn lex_tailwind_class_part<S: Source + ?Sized>(
&self,
state: &mut LexerState<'_, S, TailwindLanguage>,
) -> bool
pub fn lex_tailwind_class_part<S: Source + ?Sized>( &self, state: &mut LexerState<'_, S, TailwindLanguage>, ) -> bool
Lexes a part of a Tailwind class (modifier, utility, or arbitrary value).
Sourcepub fn lex_arbitrary_value<S: Source + ?Sized>(
&self,
state: &mut LexerState<'_, S, TailwindLanguage>,
) -> bool
pub fn lex_arbitrary_value<S: Source + ?Sized>( &self, state: &mut LexerState<'_, S, TailwindLanguage>, ) -> bool
Lexes an arbitrary value like [100px].
Sourcepub fn lex_punctuation<S: Source + ?Sized>(
&self,
state: &mut LexerState<'_, S, TailwindLanguage>,
) -> bool
pub fn lex_punctuation<S: Source + ?Sized>( &self, state: &mut LexerState<'_, S, TailwindLanguage>, ) -> bool
Lexes punctuation.
Trait Implementations§
Source§impl Clone for TailwindLexer
impl Clone for TailwindLexer
Source§fn clone(&self) -> TailwindLexer
fn clone(&self) -> TailwindLexer
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TailwindLexer
impl Debug for TailwindLexer
Source§impl Default for TailwindLexer
impl Default for TailwindLexer
Source§fn default() -> TailwindLexer
fn default() -> TailwindLexer
Returns the “default value” for a type. Read more
Source§impl Lexer<TailwindLanguage> for TailwindLexer
impl Lexer<TailwindLanguage> for TailwindLexer
Source§fn lex<'a, S: Source + ?Sized>(
&self,
source: &S,
_edits: &[TextEdit],
cache: &'a mut impl LexerCache<TailwindLanguage>,
) -> LexOutput<TailwindLanguage>
fn lex<'a, S: Source + ?Sized>( &self, source: &S, _edits: &[TextEdit], cache: &'a mut impl LexerCache<TailwindLanguage>, ) -> LexOutput<TailwindLanguage>
Tokenizes the source text into a sequence of Tailwind tokens.
Auto Trait Implementations§
impl Freeze for TailwindLexer
impl RefUnwindSafe for TailwindLexer
impl Send for TailwindLexer
impl Sync for TailwindLexer
impl Unpin for TailwindLexer
impl UnsafeUnpin for TailwindLexer
impl UnwindSafe for TailwindLexer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more