Browse Source

CSS example: parse decimal form of nums correctly

Before, 0.02 could get parsed as 0 and 0.02 when looking for nums+
master
Caleb Hearon 6 years ago
parent
commit
770ca6e723
  1. 2
      examples/css.pegjs

2
examples/css.pegjs

@ -292,7 +292,7 @@ name
= chars:nmchar+ { return chars.join(""); }
num
= [+-]? ([0-9]+ / [0-9]* "." [0-9]+) ("e" [+-]? [0-9]+)? {
= [+-]? ([0-9]* "." [0-9]+ / [0-9]+) ("e" [+-]? [0-9]+)? {
return parseFloat(text());
}

Loading…
Cancel
Save