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

Add base eval step for map keys while parsing #1175

Merged
merged 1 commit into from
May 8, 2015

Conversation

mgreter
Copy link
Contributor

@mgreter mgreter commented May 7, 2015

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

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
@mgreter mgreter self-assigned this May 7, 2015
@mgreter mgreter added this to the 3.2.3 milestone May 7, 2015
@mgreter
Copy link
Contributor Author

mgreter commented May 8, 2015

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 ...

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.13%) to 80.2% when pulling 9c74c7a on mgreter:bugfix/issue_1169 into 66631c0 on sass:master.

@xzyfer
Copy link
Contributor

xzyfer commented May 8, 2015

👍

@AlbertoElias
Copy link

That was quick! Thanks :D

@mgreter
Copy link
Contributor Author

mgreter commented May 8, 2015

@AlbertoElias Can you confirm that the PR fixes your issues?

mgreter added a commit to mgreter/libsass that referenced this pull request May 8, 2015
@mgreter mgreter merged commit 9c74c7a into sass:master May 8, 2015
@AlbertoElias
Copy link

@mgreter I can confirm it fixes it! Cheers!

@mgreter mgreter deleted the bugfix/issue_1169 branch May 8, 2015 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Quoted and unquoted colors in maps produces 'Duplicate key "transparent" in map'
4 participants