From 35da511860d7f6048ced1de54c838577a7c7c691 Mon Sep 17 00:00:00 2001 From: Connor Skees Date: Tue, 7 Jul 2020 12:02:59 -0400 Subject: [PATCH] replace `eat` terminology with `parse` --- src/parse/value/css_function.rs | 8 ++++---- src/parse/value/parse.rs | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/parse/value/css_function.rs b/src/parse/value/css_function.rs index 1445642..36a720a 100644 --- a/src/parse/value/css_function.rs +++ b/src/parse/value/css_function.rs @@ -15,7 +15,7 @@ use crate::{ use super::super::Parser; impl<'a> Parser<'a> { - pub(super) fn eat_calc_args(&mut self, buf: &mut String) -> SassResult<()> { + pub(super) fn parse_calc_args(&mut self, buf: &mut String) -> SassResult<()> { buf.reserve(2); buf.push('('); let mut nesting = 0; @@ -54,7 +54,7 @@ impl<'a> Parser<'a> { Ok(()) } - pub(super) fn eat_progid(&mut self) -> SassResult { + pub(super) fn parse_progid(&mut self) -> SassResult { let mut string = String::new(); let mut span = self.toks.peek().unwrap().pos(); while let Some(tok) = self.toks.next() { @@ -64,7 +64,7 @@ impl<'a> Parser<'a> { string.push(tok.kind); } '(' => { - self.eat_calc_args(&mut string)?; + self.parse_calc_args(&mut string)?; break; } _ => return Err(("expected \"(\".", span).into()), @@ -73,7 +73,7 @@ impl<'a> Parser<'a> { Ok(string) } - pub(super) fn try_eat_url(&mut self) -> SassResult> { + pub(super) fn try_parse_url(&mut self) -> SassResult> { let mut buf = String::from("url("); peek_whitespace(self.toks); while let Some(tok) = self.toks.peek() { diff --git a/src/parse/value/parse.rs b/src/parse/value/parse.rs index 4983b06..4fb8b44 100644 --- a/src/parse/value/parse.rs +++ b/src/parse/value/parse.rs @@ -70,7 +70,7 @@ impl<'a> Parser<'a> { space_separated.push(v.span(val.span)) } IntermediateValue::Op(op) => { - iter.eat_op( + iter.parse_op( Spanned { node: op, span: val.span, @@ -208,7 +208,7 @@ impl<'a> Parser<'a> { s = lower; self.toks.next(); s.push(':'); - s.push_str(&self.eat_progid()?); + s.push_str(&self.parse_progid()?); return Ok(Spanned { node: IntermediateValue::Value(HigherIntermediateValue::Literal(Value::String( s, @@ -273,9 +273,9 @@ impl<'a> Parser<'a> { match lower.as_str() { "calc" | "element" | "expression" => { s = lower; - self.eat_calc_args(&mut s)?; + self.parse_calc_args(&mut s)?; } - "url" => match self.try_eat_url()? { + "url" => match self.try_parse_url()? { Some(val) => s = val, None => s.push_str(&self.parse_call_args()?.to_css_string(self)?), }, @@ -742,7 +742,7 @@ impl<'a, 'b: 'a> IntermediateValueIterator<'a, 'b> { found_whitespace } - fn eat_op( + fn parse_op( &mut self, op: Spanned, space_separated: &mut Vec>,