Closed lgriesterer closed 13 years ago
In the current version, the parsing of -webkit-gradient fails because of point syntax. E.g.:
.bug { background: -webkit-gradient(linear, top left, 100% 100%, from(#ddd), to(#aaa)); }
Here is a proposed patch to support points (this pass all the tests):
diff control.py control.py.orig 44,49d43 < class Point(Value, ParseNode): < @property < def value(self): < return ' '.join(str(e) for e in self.data) < < diff parser.py parser.py.orig 7c7 < from scss.control import Variable, Expression, Point, Function, Mixin, Include, MixinParam, Extend, Variables, Option, FunctionDefinition, FunctionReturn, If, For, SepValString --- > from scss.control import Variable, Expression, Function, Mixin, Include, MixinParam, Extend, Variables, Option, FunctionDefinition, FunctionReturn, If, For, SepValString 208d207 < POINT.setParseAction(Point) diff grammar.py grammar.py.orig 5c5 < __all__ = ("STYLESHEET", "NUMBER_VALUE", "quotedString", "EXPRESSION", "POINT", "IDENT", "PATH", "VARIABLE", "VAR_DEFINITION", "VARIABLES", "FUNCTION", "COLOR_VALUE", "SCSS_COMMENT", "CSS_COMMENT", "IMPORT", "RULESET", "DECLARATION", "DECLARATION_NAME", "SELECTOR_TREE", "SELECTOR_GROUP", "SELECTOR", "MIXIN", "INCLUDE", "MIXIN_PARAM", "EXTEND", "FONT_FACE", "OPTION", "FUNCTION_DEFINITION", "FUNCTION_RETURN", "IF", "ELSE", "IF_BODY", "FOR", "FOR_BODY", "CHARSET", "MEDIA", "WARN", "SEP_VAL_STRING") --- > __all__ = ("STYLESHEET", "NUMBER_VALUE", "quotedString", "EXPRESSION", "IDENT", "PATH", "VARIABLE", "VAR_DEFINITION", "VARIABLES", "FUNCTION", "COLOR_VALUE", "SCSS_COMMENT", "CSS_COMMENT", "IMPORT", "RULESET", "DECLARATION", "DECLARATION_NAME", "SELECTOR_TREE", "SELECTOR_GROUP", "SELECTOR", "MIXIN", "INCLUDE", "MIXIN_PARAM", "EXTEND", "FONT_FACE", "OPTION", "FUNCTION_DEFINITION", "FUNCTION_RETURN", "IF", "ELSE", "IF_BODY", "FOR", "FOR_BODY", "CHARSET", "MEDIA", "WARN", "SEP_VAL_STRING") 27c27 < FUNCTION = Regex(r"-?[a-zA-Z_][-a-zA-Z0-9_]*") + PARAMS --- > FUNCTION = Regex(r"[a-zA-Z_][-a-zA-Z0-9_]*") + PARAMS 30,32c30 < POINT_PART = (NUMBER_VALUE | Regex(r"(top|bottom|left|right)")) < POINT = POINT_PART + POINT_PART < VALUE = VARIABLE | POINT | SIMPLE_VALUE --- > VALUE = VARIABLE | SIMPLE_VALUE
Fixed in version 0.8.3
Thanks
In the current version, the parsing of -webkit-gradient fails because of point syntax. E.g.:
.bug { background: -webkit-gradient(linear, top left, 100% 100%, from(#ddd), to(#aaa)); }
Here is a proposed patch to support points (this pass all the tests):