Allow functions named after constants.

This commit is contained in:
Natalie Weizenbaum 2016-10-18 16:36:10 -07:00
parent c8f0126f0b
commit 794bdee476

View File

@ -1526,6 +1526,8 @@ abstract class StylesheetParser extends Parser {
var identifier = _interpolatedIdentifier();
var plain = identifier.asPlain;
if (plain != null) {
var lower = plain.toLowerCase();
if (scanner.peekChar() != $lparen) {
switch (plain) {
case "false":
return new BooleanExpression(false, identifier.span);
@ -1543,9 +1545,9 @@ abstract class StylesheetParser extends Parser {
return new BooleanExpression(true, identifier.span);
}
var lower = plain.toLowerCase();
var color = colorsByName[lower];
if (color != null) return new ColorExpression(color, identifier.span);
}
var specialFunction = _trySpecialFunction(lower, start);
if (specialFunction != null) return specialFunction;