summaryrefslogtreecommitdiff
path: root/scss/compiler.py
diff options
context:
space:
mode:
authorEevee (Alex Munroe) <eevee.git@veekun.com>2014-08-24 13:43:14 -0700
committerEevee (Alex Munroe) <eevee.git@veekun.com>2014-08-24 13:43:14 -0700
commitc65d78ec66f24d8a5ee506c8b6568c2bbbcb6086 (patch)
tree02fffe24d20df03fe996452c544210e351958855 /scss/compiler.py
parent450b8579f11e6de93b2236a927796b78d5e30667 (diff)
downloadpyscss-c65d78ec66f24d8a5ee506c8b6568c2bbbcb6086.tar.gz
for...to excludes the upper bound. Fixes #275.
Diffstat (limited to 'scss/compiler.py')
-rw-r--r--scss/compiler.py9
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)