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

Numbers as map key produces errors #534

Closed
drewwells opened this issue Oct 12, 2014 · 7 comments · Fixed by #540 or #654
Closed

Numbers as map key produces errors #534

drewwells opened this issue Oct 12, 2014 · 7 comments · Fixed by #540 or #654

Comments

@drewwells
Copy link
Contributor

First off, thank you for adding support for sass maps!

I found some errors using more complex ones ie.

Throws an unclosed parenthesis error

$sprites: (139: (width: 96, height: 139, x: 0, y: 0, url: 'test/build/image-d65510.png'), 140: (width: 96, height: 140, x: 0, y: 139, url: 'test/build/image-d65510.png'));

In 3.0rc2, complex maps were not supported at all. I found chaining map_merges did work! However, my workaround also throws unclosed parenthesis errors in 3.0rc4.

$sprites: (); $sprites: map_merge($sprites,(139: (width: 96, height: 139, x: 0, y: 0, url: 'test/build/image-d65510.png'))); $sprites: map_merge($sprites,(140: (width: 96, height: 140, x: 0, y: 139, url: 'test/build/image-d65510.png')));
@drewwells drewwells changed the title Multi-dimensional maps throw errors in libsass 3.0rc4 Multi-dimensional maps throw unclosed parenthesis errors in libsass 3.0rc4 Oct 12, 2014
@HamptonMakes
Copy link
Member

hmmm... I was hoping that @xzyfer's maps parser fixes would have gotten this... damn maps!

@xzyfer
Copy link
Contributor

xzyfer commented Oct 14, 2014

I'll take a look at this this week. There appear to still be a couple kinks with maps, but this was not one I expected.

@xzyfer
Copy link
Contributor

xzyfer commented Oct 15, 2014

Ok this was an easy fix. I wasn't correctly parsing map keys if the were numbers.

@rawcreative
Copy link

The same error occurs with variable interpolation inside a map, e.g.

$output: (
     margin-#{from($flow)}: 0,
  );

@xzyfer
Copy link
Contributor

xzyfer commented Oct 18, 2014

The original issue is fixed in #540. I've opened #555 to address the previous comment.

@drewwells
Copy link
Contributor Author

Thanks @xzyfer have a beer on me @changetip

@changetip
Copy link

Hi xzyfer, drewwells sent you a Bitcoin tip worth a beer (10,270 bits/$3.50), and I'm here to deliver it ➔ collect your tip at ChangeTip.com.

Is this real?

@xzyfer xzyfer changed the title Multi-dimensional maps throw unclosed parenthesis errors in libsass 3.0rc4 Numbers as map key produces errors Dec 16, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants