Rename Token method equals_symbol to is_symbol

This commit is contained in:
ConnorSkees 2020-02-28 01:01:31 -05:00
parent 8619f88806
commit a91ab9007e
3 changed files with 6 additions and 6 deletions

View File

@ -143,7 +143,7 @@ pub(crate) fn eat_call_args<I: Iterator<Item = Token>>(
TokenKind::Variable(_) => {
let v = toks.next().unwrap();
devour_whitespace_or_comment(toks);
if toks.next().unwrap().equals_symbol(Symbol::Colon) {
if toks.next().unwrap().is_symbol(Symbol::Colon) {
name = v.kind.to_string();
} else {
val.push(v);

View File

@ -97,8 +97,8 @@ pub(crate) struct Token {
}
impl Token {
pub fn equals_symbol(&self, s: Symbol) -> bool {
self.kind.equals_symbol(s)
pub fn is_symbol(&self, s: Symbol) -> bool {
self.kind.is_symbol(s)
}
pub fn from_string(s: String) -> Self {
@ -168,7 +168,7 @@ pub(crate) enum TokenKind {
}
impl TokenKind {
pub fn equals_symbol(&self, s: Symbol) -> bool {
pub fn is_symbol(&self, s: Symbol) -> bool {
self == &TokenKind::Symbol(s)
}
}

View File

@ -136,7 +136,7 @@ impl<'a> StyleParser<'a> {
loop {
let property = self.parse_property(toks, super_property.clone())?;
if let Some(tok) = toks.peek() {
if tok.equals_symbol(Symbol::OpenCurlyBrace) {
if tok.is_symbol(Symbol::OpenCurlyBrace) {
match self.eat_style_group(toks, property, scope)? {
Expr::Styles(s) => styles.extend(s),
Expr::Style(s) => styles.push(*s),
@ -144,7 +144,7 @@ impl<'a> StyleParser<'a> {
}
devour_whitespace(toks);
if let Some(tok) = toks.peek() {
if tok.equals_symbol(Symbol::CloseCurlyBrace) {
if tok.is_symbol(Symbol::CloseCurlyBrace) {
toks.next();
devour_whitespace(toks);
return Ok(Expr::Styles(styles));