sass/libsass — pull request #718 by mgreter (2014-12-11 04:51:12+00:00)
Title: [WIP] Improve color token operations

This addresses a general issue how color tokens are handled.
I guess this is related to https://github.com/sass/libsass/issues/558 and https://github.com/sass/libsass/issues/629
This fixes the spec test `spec/libsass-todo-tests/libsass/colors`!

This pretty sure addresses a bug, since `unquote("red")` and `unquote(red)` would not be distinguishable, without propagating if the original variable was quoted or not. The first is a simple string, while the latter can be interpreted as a color.

input:
```
color: red + green;
color: red + hux;
color: unquote("red") + green;
color: unquote(red) + green;
```

current:
```
color: #ff8000;
color: #ff0000hux;
color: red#008000;
color: red#008000;
```

after (as expected)
```
color: #ff8000;
color: redhux;
color: redgreen;
color: #ff8000;
```

Unfortunately this breaks `spec/basic/16_hex_arithmetic`, but it somehow gets it half right and half wrong. It's still closer to the latest ruby sass version, but falls behind at one certain color shortening. Overall this looks pretty promising to get this fixed once and for all.

I don't know what the implications are by "abusing" `needs_unquoting` and by removing the `!lhs->is_delayed()` check! Therefore I leave this open as WIP for further review and comments!