Skip to content

Commit 89bf73d

Browse files
committed
Fix error message format for empty interpolants
Sass does not always show the `#{` in the error message.
1 parent 56706c0 commit 89bf73d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/parser.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -519,6 +519,10 @@ namespace Sass {
519519

520520
Argument* Parser::parse_argument(bool has_url)
521521
{
522+
if (peek_css< sequence < exactly< hash_lbrace >, exactly< rbrace > > >()) {
523+
position += 2;
524+
css_error("Invalid CSS", " after ", ": expected expression (e.g. 1px, bold), was ");
525+
}
522526

523527
Argument* arg;
524528
// some urls can look like line comments (parse literally - chunk would not work)
@@ -1723,7 +1727,7 @@ namespace Sass {
17231727
}
17241728
// we need to skip anything inside strings
17251729
// create a new target in parser/prelexer
1726-
if (peek < sequence < optional_spaces, exactly<rbrace> > >(p+2)) { position = p+2;
1730+
if (peek < sequence < optional_spaces, exactly<rbrace> > >(p+2)) { position = p;
17271731
css_error("Invalid CSS", " after ", ": expected expression (e.g. 1px, bold), was ");
17281732
}
17291733
const char* j = skip_over_scopes< exactly<hash_lbrace>, exactly<rbrace> >(p+2, id.end); // find the closing brace

0 commit comments

Comments
 (0)