fix(compiler): have CSS parser support nested parentheses inside functions

Closes #7580
This commit is contained in:
Tero Parviainen
2016-03-13 10:56:20 +02:00
committed by Misko Hevery
parent 4d6da7b1a7
commit ceac045a7f
2 changed files with 11 additions and 2 deletions
+7 -1
View File
@@ -459,8 +459,14 @@ export class CssScanner {
scanCssValueFunction(): CssToken {
var start = this.index;
var startingColumn = this.column;
while (this.peek != $EOF && this.peek != $RPAREN) {
var parenBalance = 1;
while (this.peek != $EOF && parenBalance > 0) {
this.advance();
if (this.peek == $LPAREN) {
parenBalance++;
} else if (this.peek == $RPAREN) {
parenBalance--;
}
}
var strValue = this.input.substring(start, this.index);
return new CssToken(start, startingColumn, this.line, CssTokenType.Identifier, strValue);