Fix parsing of binary -.

This commit is contained in:
Natalie Weizenbaum 2016-10-18 15:52:54 -07:00
parent 5791e1425a
commit 0f6f44f939

View File

@ -967,6 +967,7 @@ abstract class StylesheetParser extends Parser {
} else if (_lookingAtInterpolatedIdentifier()) { } else if (_lookingAtInterpolatedIdentifier()) {
addSingleExpression(_identifierLike()); addSingleExpression(_identifierLike());
} else { } else {
scanner.readChar();
addOperator(BinaryOperator.minus); addOperator(BinaryOperator.minus);
} }
break; break;
@ -1415,7 +1416,7 @@ abstract class StylesheetParser extends Parser {
while (isDigit(scanner.peekChar())) { while (isDigit(scanner.peekChar())) {
number *= 10; number *= 10;
number += scanner.readChar() - $0; number += asDecimal(scanner.readChar());
} }
if (scanner.peekChar() == $dot) { if (scanner.peekChar() == $dot) {
@ -1424,7 +1425,7 @@ abstract class StylesheetParser extends Parser {
var decimal = 0.1; var decimal = 0.1;
while (isDigit(scanner.peekChar())) { while (isDigit(scanner.peekChar())) {
number += (scanner.readChar() - $0) * decimal; number += asDecimal(scanner.readChar()) * decimal;
decimal /= 10; decimal /= 10;
} }
} }