Skip to content

Commit c522143

Browse files
committed
Make empty @return statement a parser error
1 parent a303263 commit c522143

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/parser.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2128,6 +2128,9 @@ namespace Sass {
21282128

21292129
Return* Parser::parse_return_directive()
21302130
{
2131+
// check that we do not have an empty list (ToDo: check if we got all cases)
2132+
if (peek_css < alternatives < exactly < ';' >, exactly < '}' >, end_of_file > >())
2133+
{ css_error("Invalid CSS", " after ", ": expected expression (e.g. 1px, bold), was "); }
21312134
return new (ctx.mem) Return(pstate, parse_list());
21322135
}
21332136

0 commit comments

Comments
 (0)