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

each produces different result than for loop #1723

Closed
fbid opened this issue Nov 12, 2015 · 9 comments · Fixed by #1863
Closed

each produces different result than for loop #1723

fbid opened this issue Nov 12, 2015 · 9 comments · Fixed by #1863

Comments

@fbid
Copy link

fbid commented Nov 12, 2015

EDIT: Most urgent issue is fixed, but there is still some wrong output for

Input (test.scss)

test-1 test-2 test-3 test-4 test-5,
test-6 test-7 test-8 test-9 test-10 {
    @each $set in & {
        set: inspect($set);

        @each $selector in $set {
            selector: inspect($selector);
        }
    }
}

test-1 test-2 test-3 test-4 test-5,
test-6 test-7 test-8 test-9 test-10 {
    @for $i from 1 through length(&) {
        $set: nth(&, $i);
        set: inspect($set);

        @each $selector in $set {
            selector: inspect($selector);
        }
    }
}

Ruby Sass (sass test.scss)

test-1 test-2 test-3 test-4 test-5,
test-6 test-7 test-8 test-9 test-10 {
  set: test-1 test-2 test-3 test-4 test-5;
  selector: test-1;
  selector: test-2;
  selector: test-3;
  selector: test-4;
  selector: test-5;
  set: test-6 test-7 test-8 test-9 test-10;
  selector: test-6;
  selector: test-7;
  selector: test-8;
  selector: test-9;
  selector: test-10; }

test-1 test-2 test-3 test-4 test-5,
test-6 test-7 test-8 test-9 test-10 {
  set: test-1 test-2 test-3 test-4 test-5;
  selector: test-1;
  selector: test-2;
  selector: test-3;
  selector: test-4;
  selector: test-5;
  set: test-6 test-7 test-8 test-9 test-10;
  selector: test-6;
  selector: test-7;
  selector: test-8;
  selector: test-9;
  selector: test-10; }

LibSass (sassc test.scss)

test-1 test-2 test-3 test-4 test-5,
test-6 test-7 test-8 test-9 test-10 {
  set: test-1 test-2 test-3 test-4 test-5, test-6 test-7 test-8 test-9 test-10;
  selector: test-1 test-2 test-3 test-4 test-5, test-6 test-7 test-8 test-9 test-10; }

test-1 test-2 test-3 test-4 test-5,
test-6 test-7 test-8 test-9 test-10 {
  set: test-1 test-2 test-3 test-4 test-5;
  selector: test-1;
  selector: test-2;
  selector: test-3;
  selector: test-4;
  selector: test-5;
  set: test-6 test-7 test-8 test-9 test-10;
  selector: test-6;
  selector: test-7;
  selector: test-8;
  selector: test-9;
  selector: test-10; }

Hi,

I get some errors if I compile my main.scss file with "gulp-sass".
Contrary to that, compiling using sass -w sass/main.scss:css/main.css doesn't produce any error.

From the error log it seems that "flint-calculate" does not accept content block, but as the Flint developer stated here ezekg/flint#40 , it should be accepting them.

My gulp task:

// Sass
gulp.task('sass', function () {
    gulp.src(sass_path)
        .pipe(plumber())
        .pipe(sass({outputStyle: 'expanded'}))
        .pipe(prefix())
        .pipe(gulp.dest(sass_dest));
});

This is my simple main.scss file:

@import "_flint";

.foo{
    @include _(3 4 6 12);
}

This is the error I get in the console (I'm using Plumber to catch errors):

[15:07:17] Starting 'sass'...
[15:07:17] Finished 'sass' after 3.32 ms
[15:07:17] Plumber found unhandled error:
Error in plugin 'gulp-sass'
    Message:
    sass/flint/mixins/lib/_main.scss
Error: Mixin "flint-calculate" does not accept a content block.

       Backtrace:
        sass/flint/mixins/lib/_main.scss:689, in mixin `-`
        stdin:4
        on line 689 of sass/flint/mixins/lib/_main.scss
>>                                  @include flint-calculate($calc-key, $calc-spa
   ------------------------------------------^

Details:
    formatted: Error: Mixin "flint-calculate" does not accept a content block.

       Backtrace:
        sass/flint/mixins/lib/_main.scss:689, in mixin `-`
        stdin:4
        on line 689 of sass/flint/mixins/lib/_main.scss
>>                                  @include flint-calculate($calc-key, $calc-spa
   ------------------------------------------^

    column: 46
    line: 689
    file: /Users/Ht8It1/Development/FrontEnd/FlintTest/sass/flint/mixins/lib/_main.scss
    status: 1
    messageFormatted: sass/flint/mixins/lib/_main.scss
Error: Mixin "flint-calculate" does not accept a content block.

       Backtrace:
        sass/flint/mixins/lib/_main.scss:689, in mixin `-`
        stdin:4
        on line 689 of sass/flint/mixins/lib/_main.scss
>>                                  @include flint-calculate($calc-key, $calc-spa
   ------------------------------------------^
@saper saper changed the title Errors using Flint grid compiled with Gulp-sass Infinite loop when running flint-calculate() Nov 12, 2015
@saper
Copy link
Member

saper commented Nov 12, 2015

Those errors were reported in ezekg/flint#38 and ezekg/flint#40

With libsass 3.3.2 however, I am getting sassc being stuck in a seemingly infinite loop.

To reproduce:

  • Clone git://github.com/ezekg/flint.git into /tmp/flint
  • Create input.scss:
@import "_flint";

.foo{
    @include _(3 4 6 12);
}
  • Run sassc -I /tmp/flint/stylesheets input.scss

It hangs forever until the memory available to the process is exhausted.

Would be great to have a smaller test case./

@ezekg
Copy link

ezekg commented Nov 12, 2015

Looking at trying to create a test case. I really can't figure out why this is happening. I'll look into it further tonight if I have some time.

@saper
Copy link
Member

saper commented Nov 12, 2015

My wild guess this maybe something with passing parameters - optional/rest parameter handling.

@saper
Copy link
Member

saper commented Nov 12, 2015

A backtrace while still running:

~To_String (this=0x7ffffffe5de8) at src/to_string.cpp:15
15    To_String::~To_String() { }
(gdb) bt
#0  ~To_String (this=0x7ffffffe5de8) at src/to_string.cpp:15
#1  0x0000000000538837 in Sass::Eval::operator() (this=0x7fffffff20a0, v=0x801d20c80) at src/eval.cpp:827
#2  0x00000000006733a1 in Sass::Variable::perform (this=0x801d20c80, op=0x7fffffff20a0) at ast.hpp:1160
#3  0x0000000000541e85 in Sass::Eval::operator() (this=0x7fffffff20a0, a=0x801d27a60) at src/eval.cpp:1161
#4  0x00000000004f84a1 in Sass::Argument::perform (this=0x801d27a60, op=0x7fffffff20a0) at ast.hpp:1046
#5  0x0000000000542344 in Sass::Eval::operator() (this=0x7fffffff20a0, a=0x801d279c0) at src/eval.cpp:1194
#6  0x00000000004837e1 in Sass::Arguments::perform (this=0x801d279c0, op=0x7fffffff20a0) at ast.hpp:1068
#7  0x000000000053177d in Sass::Eval::operator() (this=0x7fffffff20a0, c=0x801d27ba0) at src/eval.cpp:665
#8  0x00000000004f7401 in Sass::Function_Call::perform (this=0x801d27ba0, op=0x7fffffff20a0) at ast.hpp:1115
#9  0x000000000051f5c3 in Sass::Eval::operator() (this=0x7fffffff20a0, a=0x801d248c0) at src/eval.cpp:135
#10 0x000000000067487e in Sass::Assignment::perform (this=0x801d248c0, op=0x7fffffff20a0) at ast.hpp:533
#11 0x000000000051ec9e in Sass::Eval::operator() (this=0x7fffffff20a0, b=0x801d24800) at src/eval.cpp:73
#12 0x000000000050f51e in Sass::Block::perform (this=0x801d24800, op=0x7fffffff20a0) at ast.hpp:380
#13 0x00000000005227ac in Sass::Eval::operator() (this=0x7fffffff20a0, w=0x801d27920) at src/eval.cpp:304
#14 0x0000000000672751 in Sass::While::perform (this=0x801d27920, op=0x7fffffff20a0) at ast.hpp:678
#15 0x000000000051ec9e in Sass::Eval::operator() (this=0x7fffffff20a0, b=0x801d24680) at src/eval.cpp:73
#16 0x000000000050f51e in Sass::Block::perform (this=0x801d24680, op=0x7fffffff20a0) at ast.hpp:380
#17 0x000000000053381e in Sass::Eval::operator() (this=0x7fffffff20a0, c=0x801d2aca0) at src/eval.cpp:715
#18 0x00000000004f7401 in Sass::Function_Call::perform (this=0x801d2aca0, op=0x7fffffff20a0) at ast.hpp:1115
#19 0x000000000052282c in Sass::Eval::operator() (this=0x7fffffff20a0, r=0x801d2a980) at src/eval.cpp:312
#20 0x00000000006721b1 in Sass::Return::perform (this=0x801d2a980, op=0x7fffffff20a0) at ast.hpp:690
#21 0x000000000051ec9e in Sass::Eval::operator() (this=0x7fffffff20a0, b=0x801d24ec0) at src/eval.cpp:73
#22 0x000000000050f51e in Sass::Block::perform (this=0x801d24ec0, op=0x7fffffff20a0) at ast.hpp:380
#23 0x000000000053381e in Sass::Eval::operator() (this=0x7fffffff20a0, c=0x801cb02a0) at src/eval.cpp:715
#24 0x00000000004f7401 in Sass::Function_Call::perform (this=0x801cb02a0, op=0x7fffffff20a0) at ast.hpp:1115
#25 0x000000000051f5c3 in Sass::Eval::operator() (this=0x7fffffff20a0, a=0x801cad780) at src/eval.cpp:135
#26 0x000000000067487e in Sass::Assignment::perform (this=0x801cad780, op=0x7fffffff20a0) at ast.hpp:533
#27 0x000000000051ec9e in Sass::Eval::operator() (this=0x7fffffff20a0, b=0x801cad6c0) at src/eval.cpp:73
#28 0x000000000050f51e in Sass::Block::perform (this=0x801cad6c0, op=0x7fffffff20a0) at ast.hpp:380
#29 0x000000000051f9d3 in Sass::Eval::operator() (this=0x7fffffff20a0, i=0x801cb0340) at src/eval.cpp:150
#30 0x0000000000672d51 in Sass::If::perform (this=0x801cb0340, op=0x7fffffff20a0) at ast.hpp:636
#31 0x000000000051ec9e in Sass::Eval::operator() (this=0x7fffffff20a0, b=0x801cf9ac0) at src/eval.cpp:73
#32 0x000000000050f51e in Sass::Block::perform (this=0x801cf9ac0, op=0x7fffffff20a0) at ast.hpp:380
#33 0x0000000000521117 in Sass::Eval::operator() (this=0x7fffffff20a0, f=0x801cad840) at src/eval.cpp:204
#34 0x0000000000672b71 in Sass::For::perform (this=0x801cad840, op=0x7fffffff20a0) at ast.hpp:653
#35 0x000000000051ec9e in Sass::Eval::operator() (this=0x7fffffff20a0, b=0x801cf9880) at src/eval.cpp:73
#36 0x000000000050f51e in Sass::Block::perform (this=0x801cf9880, op=0x7fffffff20a0) at ast.hpp:380
#37 0x000000000051f9d3 in Sass::Eval::operator() (this=0x7fffffff20a0, i=0x801cb0480) at src/eval.cpp:150
#38 0x0000000000672d51 in Sass::If::perform (this=0x801cb0480, op=0x7fffffff20a0) at ast.hpp:636
#39 0x000000000051ec9e in Sass::Eval::operator() (this=0x7fffffff20a0, b=0x801cf8080) at src/eval.cpp:73
#40 0x000000000050f51e in Sass::Block::perform (this=0x801cf8080, op=0x7fffffff20a0) at ast.hpp:380
#41 0x000000000053381e in Sass::Eval::operator() (this=0x7fffffff20a0, c=0x801cfba60) at src/eval.cpp:715
#42 0x00000000004f7401 in Sass::Function_Call::perform (this=0x801cfba60, op=0x7fffffff20a0) at ast.hpp:1115
#43 0x000000000052582f in Sass::Eval::operator() (this=0x7fffffff20a0, b=0x801cfbb00) at src/eval.cpp:466
#44 0x0000000000674311 in Sass::Binary_Expression::perform (this=0x801cfbb00, op=0x7fffffff20a0) at ast.hpp:953
#45 0x00000000005fdd47 in Sass::Functions::sass_if (env=@0x7fffffff2fa8, d_env=@0x7fffffff6b48, ctx=@0x801c23280, 
    sig=0x6b4d97 "if($condition, $if-true, $if-false)", pstate=<value optimized out>, backtrace=0x7fffffff2f00)
    at src/functions.cpp:1641
#46 0x00000000005339e0 in Sass::Eval::operator() (this=0x7fffffffdb58, c=0x801d0d020) at src/eval.cpp:717
#47 0x00000000004f7401 in Sass::Function_Call::perform (this=0x801d0d020, op=0x7fffffffdb58) at ast.hpp:1115
#48 0x0000000000524d51 in Sass::Eval::operator() (this=0x7fffffffdb58, m=0x801cf7c00) at src/eval.cpp:445
#49 0x00000000004831d1 in Sass::Map::perform (this=0x801cf7c00, op=0x7fffffffdb58) at ast.hpp:884
#50 0x0000000000524d51 in Sass::Eval::operator() (this=0x7fffffffdb58, m=0x801cf7b40) at src/eval.cpp:445
#51 0x00000000004831d1 in Sass::Map::perform (this=0x801cf7b40, op=0x7fffffffdb58) at ast.hpp:884
#52 0x000000000051f5c3 in Sass::Eval::operator() (this=0x7fffffffdb58, a=0x801cf7d80) at src/eval.cpp:135
#53 0x000000000067487e in Sass::Assignment::perform (this=0x801cf7d80, op=0x7fffffffdb58) at ast.hpp:533
#54 0x000000000051ec9e in Sass::Eval::operator() (this=0x7fffffffdb58, b=0x801cf7600) at src/eval.cpp:73
#55 0x000000000050f51e in Sass::Block::perform (this=0x801cf7600, op=0x7fffffffdb58) at ast.hpp:380
#56 0x000000000053381e in Sass::Eval::operator() (this=0x7fffffffdb58, c=0x801d83c00) at src/eval.cpp:715
#57 0x00000000004f7401 in Sass::Function_Call::perform (this=0x801d83c00, op=0x7fffffffdb58) at ast.hpp:1115
#58 0x00000000005594f0 in Sass::Expand::operator() (this=0x7fffffffdb48, a=0x801d7d440) at src/expand.cpp:260
#59 0x000000000067484e in Sass::Assignment::perform (this=0x801d7d440, op=0x7fffffffdb48) at ast.hpp:533
#60 0x0000000000562276 in Sass::Expand::append_block (this=0x7fffffffdb48, b=0x801d7d380) at src/expand.cpp:684
#61 0x0000000000561616 in Sass::Expand::operator() (this=0x7fffffffdb48, c=0x801da0400) at src/expand.cpp:646
#62 0x0000000000566b71 in Sass::Mixin_Call::perform (this=0x801da0400, op=0x7fffffffdb48) at ast.hpp:791
#63 0x0000000000562276 in Sass::Expand::append_block (this=0x7fffffffdb48, b=0x801da0340) at src/expand.cpp:684
#64 0x000000000055aa81 in Sass::Expand::operator() (this=0x7fffffffdb48, i=0x801da7fc0) at src/expand.cpp:365
#65 0x0000000000672d21 in Sass::If::perform (this=0x801da7fc0, op=0x7fffffffdb48) at ast.hpp:636
#66 0x0000000000562276 in Sass::Expand::append_block (this=0x7fffffffdb48, b=0x801d9fc80) at src/expand.cpp:684
#67 0x000000000055aa81 in Sass::Expand::operator() (this=0x7fffffffdb48, i=0x801da8060) at src/expand.cpp:365
#68 0x0000000000672d21 in Sass::If::perform (this=0x801da8060, op=0x7fffffffdb48) at ast.hpp:636
#69 0x0000000000562276 in Sass::Expand::append_block (this=0x7fffffffdb48, b=0x801d954c0) at src/expand.cpp:684
#70 0x000000000055aaae in Sass::Expand::operator() (this=0x7fffffffdb48, i=0x801da8100) at src/expand.cpp:369
#71 0x0000000000672d21 in Sass::If::perform (this=0x801da8100, op=0x7fffffffdb48) at ast.hpp:636
#72 0x0000000000562276 in Sass::Expand::append_block (this=0x7fffffffdb48, b=0x801d93240) at src/expand.cpp:684
#73 0x0000000000561616 in Sass::Expand::operator() (this=0x7fffffffdb48, c=0x801dd0940) at src/expand.cpp:646
#74 0x0000000000566b71 in Sass::Mixin_Call::perform (this=0x801dd0940, op=0x7fffffffdb48) at ast.hpp:791
#75 0x0000000000562276 in Sass::Expand::append_block (this=0x7fffffffdb48, b=0x801dd0880) at src/expand.cpp:684
#76 0x0000000000555f3d in Sass::Expand::operator() (this=0x7fffffffdb48, b=0x801dd0880) at src/expand.cpp:79
#77 0x000000000050f4ee in Sass::Block::perform (this=0x801dd0880, op=0x7fffffffdb48) at ast.hpp:380
#78 0x00000000005583cf in Sass::Expand::operator() (this=0x7fffffffdb48, m=0x801de0c00) at src/expand.cpp:183
#79 0x00000000004828ce in Sass::Media_Block::perform (this=0x801de0c00, op=0x7fffffffdb48) at ast.hpp:459
#80 0x0000000000562276 in Sass::Expand::append_block (this=0x7fffffffdb48, b=0x801dd0700) at src/expand.cpp:684
#81 0x000000000055aa81 in Sass::Expand::operator() (this=0x7fffffffdb48, i=0x801de2b60) at src/expand.cpp:365
#82 0x0000000000672d21 in Sass::If::perform (this=0x801de2b60, op=0x7fffffffdb48) at ast.hpp:636
#83 0x0000000000562276 in Sass::Expand::append_block (this=0x7fffffffdb48, b=0x801dd0640) at src/expand.cpp:684
#84 0x000000000055aa81 in Sass::Expand::operator() (this=0x7fffffffdb48, i=0x801de8380) at src/expand.cpp:365
#85 0x0000000000672d21 in Sass::If::perform (this=0x801de8380, op=0x7fffffffdb48) at ast.hpp:636
#86 0x0000000000562276 in Sass::Expand::append_block (this=0x7fffffffdb48, b=0x801dd0580) at src/expand.cpp:684
#87 0x000000000055aaae in Sass::Expand::operator() (this=0x7fffffffdb48, i=0x801de8420) at src/expand.cpp:369
#88 0x0000000000672d21 in Sass::If::perform (this=0x801de8420, op=0x7fffffffdb48) at ast.hpp:636
#89 0x0000000000562276 in Sass::Expand::append_block (this=0x7fffffffdb48, b=0x801dcff80) at src/expand.cpp:684
#90 0x000000000055bf8e in Sass::Expand::operator() (this=0x7fffffffdb48, f=0x801de4a80) at src/expand.cpp:411
#91 0x0000000000672b41 in Sass::For::perform (this=0x801de4a80, op=0x7fffffffdb48) at ast.hpp:653
#92 0x0000000000562276 in Sass::Expand::append_block (this=0x7fffffffdb48, b=0x801dcfec0) at src/expand.cpp:684
#93 0x000000000055aaae in Sass::Expand::operator() (this=0x7fffffffdb48, i=0x801de84c0) at src/expand.cpp:369
#94 0x0000000000672d21 in Sass::If::perform (this=0x801de84c0, op=0x7fffffffdb48) at ast.hpp:636
#95 0x0000000000562276 in Sass::Expand::append_block (this=0x7fffffffdb48, b=0x801dcf980) at src/expand.cpp:684
#96 0x000000000055aaae in Sass::Expand::operator() (this=0x7fffffffdb48, i=0x801de8560) at src/expand.cpp:369
#97 0x0000000000672d21 in Sass::If::perform (this=0x801de8560, op=0x7fffffffdb48) at ast.hpp:636
#98 0x0000000000562276 in Sass::Expand::append_block (this=0x7fffffffdb48, b=0x801dcf440) at src/expand.cpp:684
#99 0x000000000055aa81 in Sass::Expand::operator() (this=0x7fffffffdb48, i=0x801e33480) at src/expand.cpp:365
#100 0x0000000000672d21 in Sass::If::perform (this=0x801e33480, op=0x7fffffffdb48) at ast.hpp:636
#101 0x0000000000562276 in Sass::Expand::append_block (this=0x7fffffffdb48, b=0x801dcf200) at src/expand.cpp:684
#102 0x000000000055aaae in Sass::Expand::operator() (this=0x7fffffffdb48, i=0x801e33520) at src/expand.cpp:369
#103 0x0000000000672d21 in Sass::If::perform (this=0x801e33520, op=0x7fffffffdb48) at ast.hpp:636
#104 0x0000000000562276 in Sass::Expand::append_block (this=0x7fffffffdb48, b=0x801dade00) at src/expand.cpp:684
#105 0x000000000055aaae in Sass::Expand::operator() (this=0x7fffffffdb48, i=0x801e335c0) at src/expand.cpp:369
#106 0x0000000000672d21 in Sass::If::perform (this=0x801e335c0, op=0x7fffffffdb48) at ast.hpp:636
#107 0x0000000000562276 in Sass::Expand::append_block (this=0x7fffffffdb48, b=0x801da07c0) at src/expand.cpp:684
#108 0x0000000000561616 in Sass::Expand::operator() (this=0x7fffffffdb48, c=0x801e2db00) at src/expand.cpp:646
#109 0x0000000000566b71 in Sass::Mixin_Call::perform (this=0x801e2db00, op=0x7fffffffdb48) at ast.hpp:791
#110 0x0000000000562276 in Sass::Expand::append_block (this=0x7fffffffdb48, b=0x801e2da40) at src/expand.cpp:684
#111 0x0000000000555f3d in Sass::Expand::operator() (this=0x7fffffffdb48, b=0x801e2da40) at src/expand.cpp:79
#112 0x000000000050f4ee in Sass::Block::perform (this=0x801e2da40, op=0x7fffffffdb48) at ast.hpp:380
#113 0x00000000005571d0 in Sass::Expand::operator() (this=0x7fffffffdb48, r=0x801e33660) at src/expand.cpp:123
#114 0x000000000048262e in Sass::Ruleset::perform (this=0x801e33660, op=0x7fffffffdb48) at ast.hpp:415
#115 0x0000000000562276 in Sass::Expand::append_block (this=0x7fffffffdb48, b=0x801c2e180) at src/expand.cpp:684
#116 0x0000000000555f3d in Sass::Expand::operator() (this=0x7fffffffdb48, b=0x801c2e180) at src/expand.cpp:79
#117 0x000000000050f4ee in Sass::Block::perform (this=0x801c2e180, op=0x7fffffffdb48) at ast.hpp:380
#118 0x00000000004d0b28 in Sass::Context::compile (this=0x801c23280) at src/context.cpp:642
#119 0x00000000004cf97a in Sass::File_Context::parse (this=0x801c23280) at src/context.cpp:573
#120 0x0000000000421307 in sass_parse_block (compiler=0x801c16060) at src/sass_context.cpp:305
#121 0x0000000000421131 in sass_compiler_parse (compiler=0x801c16060) at src/sass_context.cpp:450
#122 0x0000000000420db5 in sass_compile_context (c_ctx=0x801c1f100, cpp_ctx=0x801c23280) at src/sass_context.cpp:340
#123 0x000000000042101c in sass_compile_file_context (file_ctx=0x801c1f100) at src/sass_context.cpp:437
#124 0x000000000041a84f in compile_file (options=0x801c1c080, input_path=0x7fffffffeaaf "f.scss", outfile=0x0) at sassc.c:107
#125 0x000000000041b055 in main (argc=<value optimized out>, argv=<value optimized out>) at sassc.c:301

@ezekg
Copy link

ezekg commented Nov 13, 2015

The error message is misleading (I'm guessing it's due to running out of memory).

I located the issue and fixed it after some digging around with a simple change: ezekg/flint@59b9159#diff-53d9f7f0f068dabf1ef294b4181ddbcf. I made a costly mistake calling that function twice (it's quite intensive, doing a recursive search attempting to find a matching key inside a potentially large map).

I'll try to dig into it more to figure out why it was causing an infinite loop in Libsass and if that change did indeed fix the issue. I just ran your test case above, so I'll run more tomorrow.

@saper
Copy link
Member

saper commented Nov 13, 2015

Thanks! WIth flint git master ( ezekg/flint@22aa527dd2321 ) I am getting warnings and the desired output:

DEPRECATION WARNING: Passing foo, a non-string value, to unquote()
will be an error in future versions of Sass.
        on line 35 of /home/saper/sw/flint/stylesheets/flint/functions/lib/_list-to-str.scss
DEPRECATION WARNING: Passing foo, a non-string value, to unquote()
will be an error in future versions of Sass.
        on line 35 of /home/saper/sw/flint/stylesheets/flint/functions/lib/_list-to-str.scss
DEPRECATION WARNING: Passing foo, a non-string value, to unquote()
will be an error in future versions of Sass.
        on line 35 of /home/saper/sw/flint/stylesheets/flint/functions/lib/_list-to-str.scss
DEPRECATION WARNING: Passing foo, a non-string value, to unquote()
will be an error in future versions of Sass.
        on line 35 of /home/saper/sw/flint/stylesheets/flint/functions/lib/_list-to-str.scss
foo {
  float: left;
  width: 293.75%;
  margin-right: 3.125%;
  margin-left: 3.125%; }
  *, *:before, *:after {
    box-sizing: border-box; }
  @media (min-width: 60.0625em) {
    foo {
      width: 17.1875%;
      margin-right: 0.78125%;
      margin-left: 0.78125%; } }
  @media (min-width: 40.0625em) and (max-width: 60em) {
    foo {
      width: 31.25%;
      margin-right: 1.04167%;
      margin-left: 1.04167%; } }
  @media (min-width: 20.0625em) and (max-width: 40em) {
    foo {
      width: 71.875%;
      margin-right: 1.5625%;
      margin-left: 1.5625%; } }

Yes, we should try to figure out what went wrong, so I am leaving this open.

@ezekg
Copy link

ezekg commented Nov 13, 2015

I'll work on fixing those warnings tomorrow. I think I found a few more edge cases in the Libsass compilation that I'm going to look into as well. I'll report back tomorrow.

@xzyfer xzyfer added this to the 3.3.3 milestone Nov 13, 2015
@ezekg
Copy link

ezekg commented Nov 19, 2015

@xzyfer, @saper I've been running some additional tests and found this so far:

Input (test.scss)

test-1 test-2 test-3 test-4 test-5,
test-6 test-7 test-8 test-9 test-10 {
    @each $set in & {
        set: inspect($set);

        @each $selector in $set {
            selector: inspect($selector);
        }
    }
}

test-1 test-2 test-3 test-4 test-5,
test-6 test-7 test-8 test-9 test-10 {
    @for $i from 1 through length(&) {
        $set: nth(&, $i);
        set: inspect($set);

        @each $selector in $set {
            selector: inspect($selector);
        }
    }
}

Ruby Sass (sass test.scss)

test-1 test-2 test-3 test-4 test-5,
test-6 test-7 test-8 test-9 test-10 {
  set: test-1 test-2 test-3 test-4 test-5;
  selector: test-1;
  selector: test-2;
  selector: test-3;
  selector: test-4;
  selector: test-5;
  set: test-6 test-7 test-8 test-9 test-10;
  selector: test-6;
  selector: test-7;
  selector: test-8;
  selector: test-9;
  selector: test-10; }

test-1 test-2 test-3 test-4 test-5,
test-6 test-7 test-8 test-9 test-10 {
  set: test-1 test-2 test-3 test-4 test-5;
  selector: test-1;
  selector: test-2;
  selector: test-3;
  selector: test-4;
  selector: test-5;
  set: test-6 test-7 test-8 test-9 test-10;
  selector: test-6;
  selector: test-7;
  selector: test-8;
  selector: test-9;
  selector: test-10; }

LibSass (sassc test.scss)

test-1 test-2 test-3 test-4 test-5,
test-6 test-7 test-8 test-9 test-10 {
  set: test-1 test-2 test-3 test-4 test-5, test-6 test-7 test-8 test-9 test-10;
  selector: test-1 test-2 test-3 test-4 test-5, test-6 test-7 test-8 test-9 test-10; }

test-1 test-2 test-3 test-4 test-5,
test-6 test-7 test-8 test-9 test-10 {
  set: test-1 test-2 test-3 test-4 test-5;
  selector: test-1;
  selector: test-2;
  selector: test-3;
  selector: test-4;
  selector: test-5;
  set: test-6 test-7 test-8 test-9 test-10;
  selector: test-6;
  selector: test-7;
  selector: test-8;
  selector: test-9;
  selector: test-10; }

Seems like iterating over & with an @each loop doesn't behave correctly. I'm guessing this has something to do with the null values I've been getting.

Should I open a new issue for these as I find them or keep them all here?

@xzyfer
Copy link
Contributor

xzyfer commented Dec 3, 2015

@ezekg this is separate issue which is being tracked in #1757.

Let please try to keep this issue focused on one problem.

mgreter added a commit to mgreter/sass-spec that referenced this issue Jan 9, 2016
@mgreter mgreter modified the milestones: 3.3.4, 3.3.3 Jan 9, 2016
@mgreter mgreter changed the title Infinite loop when running flint-calculate() each produces different result than for loop Jan 9, 2016
@mgreter mgreter modified the milestones: 3.3.3, 3.3.4 Jan 17, 2016
@mgreter mgreter self-assigned this Jan 17, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants