-
Notifications
You must be signed in to change notification settings - Fork 465
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
Add base eval step for map keys while parsing #1175
Conversation
Keys need to be immutable for the main structure, so we need to evaluate them while the map is being parsed. We may defer the map initialization into the eval step too. Fixes sass#1169
This fixes the issues mentioned in #1169, but there are more cases where we differ from ruby sass. IMO we need to refactor Sass_Value handling internally to streamline all related things. Currenty different parts (binary operations, inspection, equal operator, etc) are scattered around our code base. We should put that all under a streamlined API, but I guess this will not be ready before 3.3. So this is a start, but as I said we have more issues like: $colors: (
"transparent": "string",
transparent: "color"
);
color { content: map-get($colors, transparent); }
string { content: map-get($colors, "transparent"); }
interpolate { content: map-get($colors, #{trans}#{parent}); } ruby sass: color {
content: "color"; }
string {
content: "string"; }
interpolate {
content: "string"; } libsass: color {
content: "color"; }
string {
content: "string"; }
interpolate {
content: "color"; } So we seem to evaluate that string somewhere unnecessarily into a color again ... |
👍 |
That was quick! Thanks :D |
@AlbertoElias Can you confirm that the PR fixes your issues? |
@mgreter I can confirm it fixes it! Cheers! |
Keys need to be immutable for the main structure, so we
need to evaluate them while the map is being parsed. We
may defer the map initialization into the eval step too.
Fixes #1169