allow omitting final semicolons

This commit is contained in:
yuanchuan 2017-06-29 22:44:14 +08:00
parent c5871d3b79
commit 74532650a7
4 changed files with 24 additions and 6 deletions

View File

@ -195,6 +195,9 @@ function pentagon() {
function hexgon() {
return polygon({ split: 6, start: 30 });
}
function hexagon() {
return polygon({ split: 6, start: 30 });
}
function heptagon() {
return polygon({ split: 7, start: -90});
@ -339,6 +342,7 @@ var shapes = Object.freeze({
rhombus: rhombus,
pentagon: pentagon,
hexgon: hexgon,
hexagon: hexagon,
heptagon: heptagon,
octagon: octagon,
star: star,
@ -852,6 +856,7 @@ function read_value(it) {
}
it.next();
}
if (text.value.length) value.push(text);
if (value.length && value[0].value) {
@ -893,8 +898,13 @@ function read_psudo(it) {
it.next();
continue;
}
else if (!psudo.selector) psudo.selector = read_selector(it);
else psudo.styles.push(read_rule(it));
else if (!psudo.selector) {
psudo.selector = read_selector(it);
}
else {
psudo.styles.push(read_rule(it));
if (it.curr() == '}') break;
}
it.next();
}
return psudo;
@ -933,6 +943,7 @@ function read_cond(it) {
else if (!is$1.white_space(c)) {
var rule = read_rule(it);
if (rule.property) cond.styles.push(rule);
if (it.curr() == '}') break;
}
it.next();
}

2
css-doodle.min.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -265,6 +265,7 @@ function read_value(it) {
}
it.next();
}
if (text.value.length) value.push(text);
if (value.length && value[0].value) {
@ -306,8 +307,13 @@ function read_psudo(it) {
it.next();
continue;
}
else if (!psudo.selector) psudo.selector = read_selector(it);
else psudo.styles.push(read_rule(it));
else if (!psudo.selector) {
psudo.selector = read_selector(it);
}
else {
psudo.styles.push(read_rule(it));
if (it.curr() == '}') break;
}
it.next();
}
return psudo;
@ -346,6 +352,7 @@ function read_cond(it) {
else if (!is.white_space(c)) {
var rule = read_rule(it);
if (rule.property) cond.styles.push(rule);
if (it.curr() == '}') break;
}
it.next();
}