mirror of
https://github.com/less/less.js.git
synced 2026-04-09 03:00:20 -04:00
Add alias for =< as <= fixes #1435
This commit is contained in:
@@ -1629,7 +1629,7 @@ less.Parser = function Parser(env) {
|
||||
if ($(/^not/)) { negate = true; }
|
||||
expect('(');
|
||||
if (a = $(this.addition) || $(this.entities.keyword) || $(this.entities.quoted)) {
|
||||
if (op = $(/^(?:>=|=<|[<=>])/)) {
|
||||
if (op = $(/^(?:>=|<=|=<|[<=>])/)) {
|
||||
if (b = $(this.addition) || $(this.entities.keyword) || $(this.entities.quoted)) {
|
||||
c = new(tree.Condition)(op, a, b, index, negate);
|
||||
} else {
|
||||
|
||||
@@ -36,8 +36,8 @@ tree.Condition.prototype = {
|
||||
index: i };
|
||||
}
|
||||
switch (result) {
|
||||
case -1: return op === '<' || op === '=<';
|
||||
case 0: return op === '=' || op === '>=' || op === '=<';
|
||||
case -1: return op === '<' || op === '=<' || op === '<=';
|
||||
case 0: return op === '=' || op === '>=' || op === '=<' || op === '<=';
|
||||
case 1: return op === '>' || op === '>=';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
.ops1 {
|
||||
height: gt-or-eq;
|
||||
height: lt-or-eq;
|
||||
height: lt-or-eq-alias;
|
||||
}
|
||||
.ops2 {
|
||||
height: gt-or-eq;
|
||||
@@ -25,6 +26,7 @@
|
||||
}
|
||||
.ops3 {
|
||||
height: lt-or-eq;
|
||||
height: lt-or-eq-alias;
|
||||
height: not-eq;
|
||||
}
|
||||
.default1 {
|
||||
|
||||
@@ -43,6 +43,9 @@
|
||||
.ops (@a) when (@a =< 0) {
|
||||
height: lt-or-eq;
|
||||
}
|
||||
.ops (@a) when (@a <= 0) {
|
||||
height: lt-or-eq-alias;
|
||||
}
|
||||
.ops (@a) when not(@a = 0) {
|
||||
height: not-eq;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user