Commit 795bce1a authored by berumuron's avatar berumuron
Browse files

fix: Fix for loop in Boopsy

parent 2210ce4e
...@@ -126,12 +126,12 @@ class Template: ...@@ -126,12 +126,12 @@ class Template:
code.indent() code.indent()
elif statement == "for": elif statement == "for":
if len(args) != 3: if len(args) < 3:
self._oopsy("for statement expects 3 arguments") self._oopsy("for statement expects at least 3 arguments")
if args[1] != "in": if "in" not in args:
self._oopsy("for statement expects second argument to be 'in'") self._oopsy("for statement expects arguments to contain 'in'")
ops_stack.append("for") ops_stack.append("for")
code.write(f"for {args[0]} in {args[2]}:") code.write(f"for {' '.join(args)}:")
code.indent() code.indent()
elif statement == "endif" or statement == "endfor": elif statement == "endif" or statement == "endfor":
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment