for loop bounds to/through
mfield opened this issue · 0 comments
mfield commented
Looks like @for ... to
and @for ... through
are both being treated as the "through" style, inclusive on both ends of the range. "to" should exclude the upper bound [scss docs].
I see the same results on 1.3.0.dev1 (current master) and 1.2.0.post3.
In [1]: import scss
In [2]: css = scss.Scss()
In [3]: css.compile('''.foo {
...: @for $var from 1 to 5 {a: $var;}
...: }
...: ''')
Out[3]: '.foo {\n a: 1;\n a: 2;\n a: 3;\n a: 4;\n a: 5; }\n'
In [4]: css.compile(('''.foo {
...: @for $var from 1 through 5 {a: $var;}
...: }
...: '''))
Out[4]: '.foo {\n a: 1;\n a: 2;\n a: 3;\n a: 4;\n a: 5; }\n'