Skip to content
New issue

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

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

Already on GitHub? # to your account

Output leading zeros on numbers as seen in input (Fixes #550) #624

Merged
merged 1 commit into from
Nov 6, 2014

Conversation

mgreter
Copy link
Contributor

@mgreter mgreter commented Nov 6, 2014

This fixes #550 and some other related issues!

To do this I had to add a status bool to Number to preserve the state that we have parsed!
Turned out to be trickier than anticipated, but it should now be in line with ruby sass!

I initially implemented that status flag on all number representations down to the C interface, but decided to drop it for now as it would mean a small change in the API and I added this a local branch for now.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.0%) when pulling 370e038 on mgreter:issue/550 into 5375056 on sass:master.

n->position(),
n->value(),
n->unit(),
true);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be n->zero() rather than hardcoded to true?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope, it should be that way, as ruby sass outputs it with a leading zero if it is comming from a variable (even in you've written it without). This is exactly what makes libsass behave the same way and the spec tests include this one!

@xzyfer
Copy link
Contributor

xzyfer commented Nov 6, 2014

Keep this bool flag in the AST node makes sense. I don't see any reason to modify the C API for this. I took a run at this last week but eventually got caught on #549.

@mgreter
Copy link
Contributor Author

mgreter commented Nov 6, 2014

Issue #549 seems to be another issue but might be related to #623

mgreter added a commit that referenced this pull request Nov 6, 2014
Output leading zeros on numbers as seen in input (Fixes #550)
@mgreter mgreter merged commit ca82f08 into sass:master Nov 6, 2014
@mgreter mgreter deleted the issue/550 branch April 6, 2015 17:14
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fractional numbers such as ".01" get displayed as "0.01"
3 participants