oxc-css-parser 0.0.3

Parser for CSS, SCSS, Sass, and Less.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use super::{TokenWithSpan, token::Ident};
use crate::{SpanIgnoredEq, util};
use std::borrow::Cow;

impl<'s> Ident<'s> {
    #[inline]
    pub fn name(&self) -> Cow<'s, str> {
        if self.escaped { util::handle_escape(self.raw) } else { Cow::from(self.raw) }
    }
}

impl SpanIgnoredEq for TokenWithSpan<'_> {
    #[inline]
    fn span_ignored_eq(&self, other: &Self) -> bool {
        self.token == other.token
    }
}