diff --git a/OscCommentMacroListener.py b/OscCommentMacroListener.py index 3092a6b..07d41bc 100644 --- a/OscCommentMacroListener.py +++ b/OscCommentMacroListener.py @@ -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: