Commit 9961ae15 by Aaron Leung

Don't munch keywords when they prefix a longer identifier.

parent e2c130b1
...@@ -3,4 +3,8 @@ div { ...@@ -3,4 +3,8 @@ div {
b: hey or ho or hoo; b: hey or ho or hoo;
c: hey and false and (1/0); c: hey and false and (1/0);
d: 1 > 2 or 1+3 < 1 or bungle; d: 1 > 2 or 1+3 < 1 or bungle;
e: 1 > 2 or 1 < 2 and fungible;
/* things that aren't logical keywords */
a: hey andalso ho and-come-on hoo;
b: hey orelse ho andalso hoo;
} }
\ No newline at end of file
...@@ -448,11 +448,11 @@ namespace Sass { ...@@ -448,11 +448,11 @@ namespace Sass {
{ {
Node conj1(parse_conjunction()); Node conj1(parse_conjunction());
// if it's a singleton, return it directly; don't wrap it // if it's a singleton, return it directly; don't wrap it
if (!peek< or_kwd >()) return conj1; if (!peek< sequence< or_kwd, negate< identifier > > >()) return conj1;
Node disjunction(Node::disjunction, line_number, 2); Node disjunction(Node::disjunction, line_number, 2);
disjunction << conj1; disjunction << conj1;
while (lex< or_kwd >()) disjunction << parse_conjunction(); while (lex< sequence< or_kwd, negate< identifier > > >()) disjunction << parse_conjunction();
disjunction.eval_me = true; disjunction.eval_me = true;
return disjunction; return disjunction;
...@@ -462,11 +462,11 @@ namespace Sass { ...@@ -462,11 +462,11 @@ namespace Sass {
{ {
Node rel1(parse_relation()); Node rel1(parse_relation());
// if it's a singleton, return it directly; don't wrap it // if it's a singleton, return it directly; don't wrap it
if (!peek< and_kwd >()) return rel1; if (!peek< sequence< and_kwd, negate< identifier > > >()) return rel1;
Node conjunction(Node::conjunction, line_number, 2); Node conjunction(Node::conjunction, line_number, 2);
conjunction << rel1; conjunction << rel1;
while (lex< and_kwd >()) conjunction << parse_relation(); while (lex< sequence< and_kwd, negate< identifier > > >()) conjunction << parse_relation();
conjunction.eval_me = true; conjunction.eval_me = true;
return conjunction; return conjunction;
} }
......
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