Skip to main content

oxc_css_parser/tokenizer/
misc.rs

1use super::{TokenWithSpan, token::Ident};
2use crate::{SpanIgnoredEq, util};
3use std::borrow::Cow;
4
5impl<'s> Ident<'s> {
6    #[inline]
7    pub fn name(&self) -> Cow<'s, str> {
8        if self.escaped {
9            util::handle_escape(self.raw)
10        } else {
11            Cow::from(self.raw)
12        }
13    }
14}
15
16impl SpanIgnoredEq for TokenWithSpan<'_> {
17    #[inline]
18    fn span_ignored_eq(&self, other: &Self) -> bool {
19        self.token == other.token
20    }
21}