-
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
Decimal litterals are truncated #923
Comments
a) No idea what you're doing wrong and b) no, sorry, works correctly here! |
Going to close this as |
I just managed to get a little more information to locate my error: It seems that the truncation of the numbers happens at parse time (as opposed to output time), because of the two following things:
is compiled to
when the value of the margin should clealy be I can't figure out where the problem could be coming from by looking at the libsass source code. Could I be missing some compiler flag, or could I possibly have a version of some library (maybe the one that is used to convert strings to numbers) that is not what libsass expects? |
Actually, I just found the source of the problem and it is indeed a bug in libsass. In version 3.1.0 it occurs at eval.cpp:627
the problem here is that
Specifically, There are multiple other usages of I think this issue can be re-opened now. |
Can you try the fix I have pushed to my current WIP branch! |
By the way, the best way to reproduce this reliably on any system for me was to modify
Then run
where the contents of test.scss was
|
Can you confirm that the latest master fixes this issue? If not I will have to take deeper look and test this more thoroughly. I just "hope" the fix I've added does what it should (and if it doesn't, it should be easy to correct it once and for all)! |
Fixes sass#923 Conflicts: eval.cpp util.cpp util.hpp
I'm currently working on libsass-maven-plugin, and I've encountered a strange behavior. For some reason all decimal litterals in my .scss file are truncated.
Here is an example of .scss code that causes the problem for me:
The code that is generated is the following:
I'm obviously doing something wrong when calling
sass_compile_file()
, I have no idea what.Before calling
sass_compile_file()
, I create obtain asass_file_context
viasass_new_file_context()
, then set the options as needed. All the options seem to work fine.The only problem I have is the one outlined above. Setting the
precision
field of thesass_options
struct seems to have no effect.I'm using version 3.1 of libsass. commit 31521ef to be precise.
Do anyone have an idea if I'm doing anything wrong, or is that a bug in the library.
The text was updated successfully, but these errors were encountered: