Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow unparenthesized expressions to contain more than one comparison operator #1727

Closed
andrew-skybound opened this issue Nov 13, 2015 · 2 comments

Comments

@andrew-skybound
Copy link

Ruby SASS allows multiple comparison operators to appear in a single unparenthesized expression, in the format:

    a == b == c
    a > b == c

And so on. Indeed "c" needs to be a boolean value for this to be useful but it is nevertheless supported. Libsass currently only allows one comparison operator (== != > >= < <=) per unparenthesized expression.

Input:

$x: 2;
$y: 1;

@function getResult() {
    @return true;
}

.test {
    a: $x > $y == getResult();
}

Ruby SASS Output (3.4.19):

.test {
  a: true;
}

Libsass Output (3.2.5):

Error: error reading values after $y
        on line 9 of test.scss
>>      a: $x > $y == getResult();
   -----------^
@xzyfer
Copy link
Contributor

xzyfer commented Nov 13, 2015

Spec added sass/sass-spec#603

@mgreter mgreter modified the milestones: 3.3.3, 3.4 Jan 9, 2016
@mgreter mgreter self-assigned this Jan 9, 2016
@mgreter
Copy link
Contributor

mgreter commented Jan 13, 2016

This was one of the major fixes in the milestone 3.4 branch and I've added a pretty extensive test suite to back up this feature! Code for it is a bit dirty in some places, but specs do pass!

@mgreter mgreter closed this as completed Jan 13, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants