From 78221bf2a22ecdedee4bcd63d0e3036c3757e4d1 Mon Sep 17 00:00:00 2001 From: xzyfer Date: Sat, 27 Dec 2014 12:41:32 +1100 Subject: [PATCH] Consume more superfluous semicolons --- parser.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/parser.cpp b/parser.cpp index 6f08f5592b..3ef858a9bf 100644 --- a/parser.cpp +++ b/parser.cpp @@ -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; @@ -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(); @@ -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); @@ -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()*/);