resolve newly failing tests from merge

This commit is contained in:
Connor Skees 2020-07-29 08:58:21 -04:00
parent a8ec130f64
commit 2fb19e161e

View File

@ -297,7 +297,10 @@ impl<'a> Parser<'a> {
.span(module_span)) .span(module_span))
} }
fn parse_ident_value(&mut self) -> SassResult<Spanned<IntermediateValue>> { fn parse_ident_value(
&mut self,
predicate: &dyn Fn(&mut PeekMoreIterator<IntoIter<Token>>) -> bool,
) -> SassResult<Spanned<IntermediateValue>> {
let Spanned { node: mut s, span } = self.parse_identifier()?; let Spanned { node: mut s, span } = self.parse_identifier()?;
self.span_before = span; self.span_before = span;
@ -384,8 +387,10 @@ impl<'a> Parser<'a> {
.span(span)); .span(span));
} }
Some(Token { kind: '.', .. }) => { Some(Token { kind: '.', .. }) => {
self.toks.next(); if !predicate(self.toks) {
return self.parse_module_item(&s, span); self.toks.next();
return self.parse_module_item(&s, span);
}
} }
_ => {} _ => {}
} }
@ -524,7 +529,7 @@ impl<'a> Parser<'a> {
|| (!kind.is_ascii() && !kind.is_control()) || (!kind.is_ascii() && !kind.is_control())
|| (kind == '-' && self.next_is_hypen()) => || (kind == '-' && self.next_is_hypen()) =>
{ {
return Some(self.parse_ident_value()); return Some(self.parse_ident_value(predicate));
} }
'0'..='9' | '.' => { '0'..='9' | '.' => {
let Spanned { let Spanned {
@ -652,7 +657,7 @@ impl<'a> Parser<'a> {
if let Some(Token { kind: '{', pos }) = self.toks.peek_forward(1) { if let Some(Token { kind: '{', pos }) = self.toks.peek_forward(1) {
self.span_before = *pos; self.span_before = *pos;
self.toks.reset_cursor(); self.toks.reset_cursor();
return Some(self.parse_ident_value()); return Some(self.parse_ident_value(predicate));
} }
self.toks.reset_cursor(); self.toks.reset_cursor();
self.toks.next(); self.toks.next();