diff options
author | Eevee (Alex Munroe) <eevee.git@veekun.com> | 2014-08-24 13:43:14 -0700 |
---|---|---|
committer | Eevee (Alex Munroe) <eevee.git@veekun.com> | 2014-08-24 13:43:14 -0700 |
commit | c65d78ec66f24d8a5ee506c8b6568c2bbbcb6086 (patch) | |
tree | 02fffe24d20df03fe996452c544210e351958855 /scss/compiler.py | |
parent | 450b8579f11e6de93b2236a927796b78d5e30667 (diff) | |
download | pyscss-c65d78ec66f24d8a5ee506c8b6568c2bbbcb6086.tar.gz |
for...to excludes the upper bound. Fixes #275.
Diffstat (limited to 'scss/compiler.py')
-rw-r--r-- | scss/compiler.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/scss/compiler.py b/scss/compiler.py index 23b9487..942de82 100644 --- a/scss/compiler.py +++ b/scss/compiler.py @@ -941,7 +941,10 @@ class Compilation(object): """ var, _, name = block.argument.partition(' from ') frm, _, through = name.partition(' through ') - if not through: + if through: + inclusive = True + else: + inclusive = False frm, _, through = frm.partition(' to ') frm = calculator.calculate(frm) through = calculator.calculate(through) @@ -967,7 +970,9 @@ class Compilation(object): # DEVIATION: Allow not creating a new namespace inner_rule.namespace = rule.namespace - for i in rev(range(frm, through + 1)): + if inclusive: + through += 1 + for i in rev(range(frm, through)): inner_rule.namespace.set_variable(var, Number(i)) self.manage_children(inner_rule, scope) |