diff --git a/src/main.rs b/src/main.rs index b114796..ec89578 100644 --- a/src/main.rs +++ b/src/main.rs @@ -432,7 +432,7 @@ fn parse_mixin>( } body.push(tok) } else { - todo!("unexpected EOF") + return Err(Printer::Error(pos, String::from("unexpected EOF"))); } } @@ -518,7 +518,7 @@ pub(crate) fn eat_expr>( devour_whitespace(toks); return Ok(Some(Expr::VariableDecl( name, - eat_variable_value(toks, scope)? + eat_variable_value(toks, scope)?, ))); } else { values.push(Token { @@ -542,9 +542,11 @@ pub(crate) fn eat_expr>( } } TokenKind::AtRule(AtRule::Include) => { - return Ok(Some(Expr::Include( - eat_include(toks, scope, super_selector)?, - ))); + return Ok(Some(Expr::Include(eat_include( + toks, + scope, + super_selector, + )?))); } TokenKind::AtRule(AtRule::Mixin) => { toks.next(); diff --git a/src/mixin.rs b/src/mixin.rs index 50a84ea..5393c9e 100644 --- a/src/mixin.rs +++ b/src/mixin.rs @@ -39,7 +39,11 @@ impl Mixin { self } - pub fn eval(&mut self, super_selector: &Selector, scope: &mut Scope) -> Result, (Pos, &'static str)> { + pub fn eval( + &mut self, + super_selector: &Selector, + scope: &mut Scope, + ) -> Result, (Pos, &'static str)> { let mut stmts = Vec::new(); while let Some(expr) = eat_expr(&mut self.body, scope, super_selector)? { match expr {