diff --git a/src/parse/mod.rs b/src/parse/mod.rs index df4ca75..7a21f2a 100644 --- a/src/parse/mod.rs +++ b/src/parse/mod.rs @@ -569,7 +569,10 @@ impl<'a> Parser<'a> { { self.toks.next(); self.toks.next(); - let cond = if !found_true { + let cond = if found_true { + self.throw_away_until_open_curly_brace()?; + false + } else { let v = self.parse_value()?.node.is_true(); match self.toks.next() { Some(Token { kind: '{', .. }) => {} @@ -578,9 +581,6 @@ impl<'a> Parser<'a> { } } v - } else { - self.throw_away_until_open_curly_brace()?; - false }; if cond { found_true = true; diff --git a/src/parse/throw_away.rs b/src/parse/throw_away.rs index e6bf9fe..1ef0ae3 100644 --- a/src/parse/throw_away.rs +++ b/src/parse/throw_away.rs @@ -34,7 +34,7 @@ impl<'a> Parser<'a> { _ => {} } } - return Err((format!("Expected {}.", q), self.span_before).into()); + Err((format!("Expected {}.", q), self.span_before).into()) } pub(super) fn throw_away_until_open_curly_brace(&mut self) -> SassResult<()> {