diff --git a/src/utils/comment_whitespace.rs b/src/utils/comment_whitespace.rs index f3b1a18..386ecd0 100644 --- a/src/utils/comment_whitespace.rs +++ b/src/utils/comment_whitespace.rs @@ -50,7 +50,7 @@ pub(crate) fn peek_whitespace_or_comment(s: &mut PeekMoreIterator match s.peek_forward(1) { + '/' => match s.peek_next() { Some(Token { kind: '/', .. }) => { peek_until_newline(s); found_whitespace = true; @@ -60,7 +60,8 @@ pub(crate) fn peek_whitespace_or_comment(s: &mut PeekMoreIterator { - if matches!(s.peek_forward(1), Some(Token { kind: '/', .. })) { + if matches!(s.peek_next(), Some(Token { kind: '/', .. })) { + s.advance_cursor(); break; } } diff --git a/tests/args.rs b/tests/args.rs index 6c8de5f..37bb585 100644 --- a/tests/args.rs +++ b/tests/args.rs @@ -168,3 +168,14 @@ error!( filter_value_after_equal_is_last_char, "a {\n color: foo(a=a", "Error: expected \")\"." ); +test!( + space_after_loud_comment, + "@mixin foo($x) { + color: $x; + } + + a { + @include foo($x /* blah */ : kwd-y); + }", + "a {\n color: kwd-y;\n}\n" +);