Skip to content

Commit

Permalink
Consume more superfluous semicolons
Browse files Browse the repository at this point in the history
  • Loading branch information
xzyfer committed Dec 27, 2014
1 parent 6f716d7 commit 78221bf
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,9 @@ namespace Sass {
else if ((lookahead_result = lookahead_for_selector(position)).found) {
(*root) << parse_ruleset(lookahead_result);
}
else if (peek< exactly<';'> >()) {
lex< one_plus< exactly<';'> > >();
}
else {
lex< spaces_and_comments >();
if (position >= end) break;
Expand Down Expand Up @@ -776,7 +779,7 @@ namespace Sass {
// ignore the @charset directive for now
else if (lex< exactly< charset_kwd > >()) {
lex< string_constant >();
lex< exactly<';'> >();
lex< one_plus< exactly<';'> > >();
}
else if (peek< at_keyword >()) {
At_Rule* at_rule = parse_at_rule();
Expand Down Expand Up @@ -810,7 +813,7 @@ namespace Sass {
}
}
}
else lex< exactly<';'> >();
else lex< one_plus< exactly<';'> > >();
while (lex< block_comment >()) {
String* contents = parse_interpolated_chunk(lexed);
Comment* comment = new (ctx.mem) Comment(path, source_position, contents);
Expand All @@ -834,7 +837,7 @@ namespace Sass {
else {
error("invalid property name");
}
if (!lex< exactly<':'> >()) error("property \"" + string(lexed) + "\" must be followed by a ':'");
if (!lex< one_plus< exactly<':'> > >()) error("property \"" + string(lexed) + "\" must be followed by a ':'");
if (peek< exactly<';'> >()) error("style declaration must contain a value");
if (peek< static_value >()) {
return new (ctx.mem) Declaration(path, prop->position(), prop, parse_static_value()/*, lex<important>()*/);
Expand Down

0 comments on commit 78221bf

Please sign in to comment.