diff --git a/src/parse/module.rs b/src/parse/module.rs index f6a056b..4a2a9ae 100644 --- a/src/parse/module.rs +++ b/src/parse/module.rs @@ -186,7 +186,9 @@ impl<'a> Parser<'a> { let quote = match self.toks.next() { Some(Token { kind: q @ '"', .. }) | Some(Token { kind: q @ '\'', .. }) => q, - Some(..) | None => todo!(), + Some(..) | None => { + return Err(("Expected string.", self.span_before).into()) + } }; let Spanned { node: module, span } = self.parse_quoted_string(quote)?; diff --git a/tests/use.rs b/tests/use.rs index c1017da..65b32b4 100644 --- a/tests/use.rs +++ b/tests/use.rs @@ -38,6 +38,10 @@ error!( module_function_missing_open_parens, "@use \"sass:math\";\na { color: math.floor; }", "Error: expected \"(\"." ); +error!( + module_not_quoted_string, + "@use a", "Error: Expected string." +); test!( use_as, "@use \"sass:math\" as foo;