diff --git a/src/lexer.rs b/src/lexer.rs index cc762d4..e8aa1dd 100644 --- a/src/lexer.rs +++ b/src/lexer.rs @@ -40,7 +40,12 @@ impl<'a> Iterator for Lexer<'a> { impl<'a> Lexer<'a> { pub fn new(file: &'a Arc) -> Lexer<'a> { Lexer { - buf: file.source().trim_start_matches("\u{ef}\u{bb}\u{bf}").trim_start_matches("\u{feff}").chars().peekable(), + buf: file + .source() + .trim_start_matches("\u{ef}\u{bb}\u{bf}") + .trim_start_matches("\u{feff}") + .chars() + .peekable(), pos: 0, file, } diff --git a/src/parse/value/parse.rs b/src/parse/value/parse.rs index 5577915..5effa3b 100644 --- a/src/parse/value/parse.rs +++ b/src/parse/value/parse.rs @@ -220,9 +220,7 @@ impl<'a> Parser<'a> { .get_fn(fn_name)? .ok_or(("Undefined function.", fn_name.span))?; - if !matches!(self.toks.next(), Some(Token { kind: '(', .. })) { - todo!() - } + self.expect_char('(')?; let call_args = self.parse_call_args()?; diff --git a/tests/use.rs b/tests/use.rs index 928ebec..c1017da 100644 --- a/tests/use.rs +++ b/tests/use.rs @@ -34,6 +34,10 @@ error!( unknown_function, "@use \"sass:math\";\na { color: math.bar(); }", "Error: Undefined function." ); +error!( + module_function_missing_open_parens, + "@use \"sass:math\";\na { color: math.floor; }", "Error: expected \"(\"." +); test!( use_as, "@use \"sass:math\" as foo;