Commit 748532bb by Aaron Leung

Handling empty rules (i.e., extra semicolons, but it's subtle).

parent a6ae423a
......@@ -73,7 +73,7 @@ namespace Sass {
lex< exactly<'{'> >();
bool semicolon = false;
Node block(line_number, Node::block);
while (!lex < exactly<'}'> >()) {
while (!lex< exactly<'}'> >()) {
if (semicolon) {
lex< exactly<';'> >(); // enforce terminal ';' here
semicolon = false;
......@@ -84,23 +84,20 @@ namespace Sass {
block << Node(line_number, Node::comment, lexed);
block.has_rules_or_comments = true;
semicolon = true;
continue;
}
else if (lex< variable >()) {
parse_var_def();
continue;
}
else if (look_for_rule(position)) {
block << parse_rule();
block.has_rules_or_comments = true;
semicolon = true;
continue;
}
else {
else if (!peek< exactly<';'> >()) {
block << parse_ruleset();
block.has_rulesets = true;
continue;
}
else lex< exactly<';'> >();
}
return block;
// lex< identifier >();
......
......@@ -13,7 +13,7 @@ div {
text-decoration: none; /* where will this comment go? */
color: green;
/* what about this comment? */ border: 1px $blah red;
}
};;
/* yet another comment that should be preserved */
display: inline-block;
} // gone!
......@@ -26,7 +26,8 @@ div {
}
p {
padding: 10px 8%;
-webkit-box-sizing: $blux;
-webkit-box-sizing: $blux; ; ;
; ; ;;;
}
margin: 10px 5px;
h1 {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment