From dcdd2a1cb13330fff64f2aaa235b47641cda09cd Mon Sep 17 00:00:00 2001 From: ConnorSkees <39542938+ConnorSkees@users.noreply.github.com> Date: Sat, 16 May 2020 16:54:34 -0400 Subject: [PATCH] edge case in which @ include had no args AND no semicolon --- src/atrule/mixin.rs | 13 +++++++++---- tests/mixins.rs | 5 +++++ 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/src/atrule/mixin.rs b/src/atrule/mixin.rs index b41f295..f80abb3 100644 --- a/src/atrule/mixin.rs +++ b/src/atrule/mixin.rs @@ -199,11 +199,16 @@ pub(crate) fn eat_include>( '(' => { 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 diff --git a/tests/mixins.rs b/tests/mixins.rs index c10f4bc..28a2e21 100644 --- a/tests/mixins.rs +++ b/tests/mixins.rs @@ -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", + "" +);