Commit c455b21b by Aaron Leung

Fixed incorrect fetching of union members in the unit math evaluator.

parent 161d1148
...@@ -262,8 +262,8 @@ namespace Sass { ...@@ -262,8 +262,8 @@ namespace Sass {
Node accumulate(Node::Type op, Node& acc, Node& rhs, vector<vector<Node>*>& registry) Node accumulate(Node::Type op, Node& acc, Node& rhs, vector<vector<Node>*>& registry)
{ {
Node lhs(acc.content.children->back()); Node lhs(acc.content.children->back());
double lnum = lhs.content.numeric_value; double lnum = lhs.numeric_value();
double rnum = rhs.content.numeric_value; double rnum = rhs.numeric_value();
if (lhs.type == Node::number && rhs.type == Node::number) { if (lhs.type == Node::number && rhs.type == Node::number) {
Node result(acc.line_number, operate(op, lnum, rnum)); Node result(acc.line_number, operate(op, lnum, rnum));
......
...@@ -80,7 +80,14 @@ namespace Sass { ...@@ -80,7 +80,14 @@ namespace Sass {
exactly<'_'> > > >(src); exactly<'_'> > > >(src);
} }
// Match interpolant schemas // Match interpolant schemas
const char* identifier_schema(const char* src) {
// follows this pattern: (x*ix*)+
return one_plus< sequence< zero_plus< identifier >,
interpolant,
zero_plus< identifier > > >(src);
}
const char* value_schema(const char* src) { const char* value_schema(const char* src) {
// follows this pattern: ([xyz]*i[xyz]*)+ // follows this pattern: ([xyz]*i[xyz]*)+
return one_plus< sequence< zero_plus< alternatives< identifier, percentage, dimension, hex, number, string_constant > >, return one_plus< sequence< zero_plus< alternatives< identifier, percentage, dimension, hex, number, string_constant > >,
......
...@@ -303,6 +303,7 @@ namespace Sass { ...@@ -303,6 +303,7 @@ namespace Sass {
// Match a CSS identifier. // Match a CSS identifier.
const char* identifier(const char* src); const char* identifier(const char* src);
// Match interpolant schemas // Match interpolant schemas
const char* identifier_schema(const char* src);
const char* value_schema(const char* src); const char* value_schema(const char* src);
// Match CSS '@' keywords. // Match CSS '@' keywords.
const char* at_keyword(const char* src); const char* at_keyword(const char* src);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment