edge case in which @ include had no args AND no semicolon

This commit is contained in:
ConnorSkees 2020-05-16 16:54:34 -04:00
parent 223dade62b
commit dcdd2a1cb1
2 changed files with 14 additions and 4 deletions

View File

@ -199,11 +199,16 @@ pub(crate) fn eat_include<I: Iterator<Item = Token>>(
'(' => {
let tmp = eat_call_args(toks)?;
devour_whitespace_or_comment(toks)?;
if let Some(tok) = toks.next() {
if let Some(tok) = toks.peek() {
match tok.kind {
';' => {}
'{' => has_content = true,
_ => todo!(),
';' => {
toks.next();
}
'{' => {
toks.next();
has_content = true
}
_ => {}
}
}
tmp

View File

@ -233,3 +233,8 @@ error!(
undefined_mixin,
"a {@include foo;}", "Error: Undefined mixin."
);
test!(
include_empty_args_no_semicolon,
"@mixin c {}\n\na {\n @include c()\n}\n",
""
);