cleanup span calculation
This commit is contained in:
parent
860088078d
commit
bc1e5920db
|
@ -45,14 +45,6 @@ def beautify_lisp_string(in_string):
|
|||
return out_string
|
||||
|
||||
|
||||
# floating point ranges
|
||||
def frange(start, stop, step=1):
|
||||
i = start
|
||||
while i < stop:
|
||||
yield i
|
||||
i += step
|
||||
|
||||
|
||||
class HogDevice():
|
||||
# button state constants
|
||||
buttonDOWN = 1
|
||||
|
@ -123,10 +115,11 @@ class OscCommentMacroListener(CommentMacroListener):
|
|||
ctx.parentCtx.targets.append(ctx.value)
|
||||
|
||||
def exitSpan(self, ctx: CommentMacroParser.SpanContext):
|
||||
minimum = min(ctx.n1.value, ctx.n2.value)
|
||||
maximum = max(ctx.n1.value, ctx.n2.value)
|
||||
for i in (frange(minimum, maximum + 1)):
|
||||
ctx.parentCtx.targets.append(i)
|
||||
lower = min(ctx.n1.value, ctx.n2.value)
|
||||
upper = max(ctx.n1.value, ctx.n2.value)
|
||||
while lower <= upper:
|
||||
ctx.parentCtx.targets.append(lower)
|
||||
lower += 1
|
||||
|
||||
def exitMasterGo(self, ctx: CommentMacroParser.MasterGoContext):
|
||||
if ctx.target() is None:
|
||||
|
|
Loading…
Reference in New Issue