Skip to content

Commit

Permalink
Merge pull request #182 from Thunno/v2.2.25
Browse files Browse the repository at this point in the history
v2.2.25
  • Loading branch information
nayakrujul authored Aug 15, 2023
2 parents a039350 + 95fd731 commit 192686c
Show file tree
Hide file tree
Showing 22 changed files with 27 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ src/thunno2.egg-info/

# Others
.DS_Store
*/__pycache__/
*.pyc
Binary file removed src/__pycache__/test_run.cpython-39.pyc
Binary file not shown.
Binary file removed src/thunno2/__pycache__/__init__.cpython-311.pyc
Binary file not shown.
Binary file removed src/thunno2/__pycache__/__init__.cpython-39.pyc
Binary file not shown.
Binary file not shown.
Binary file removed src/thunno2/__pycache__/canvas.cpython-39.pyc
Binary file not shown.
Binary file removed src/thunno2/__pycache__/codepage.cpython-39.pyc
Binary file not shown.
Binary file removed src/thunno2/__pycache__/commands.cpython-39.pyc
Binary file not shown.
Binary file removed src/thunno2/__pycache__/constants.cpython-39.pyc
Binary file not shown.
Binary file removed src/thunno2/__pycache__/dictionary.cpython-39.pyc
Binary file not shown.
Binary file removed src/thunno2/__pycache__/flags.cpython-39.pyc
Binary file not shown.
Binary file removed src/thunno2/__pycache__/helpers.cpython-39.pyc
Binary file not shown.
Binary file removed src/thunno2/__pycache__/interpreter.cpython-39.pyc
Binary file not shown.
Binary file removed src/thunno2/__pycache__/lexer.cpython-39.pyc
Binary file not shown.
Binary file removed src/thunno2/__pycache__/run.cpython-39.pyc
Binary file not shown.
Binary file removed src/thunno2/__pycache__/tests.cpython-39.pyc
Binary file not shown.
Binary file removed src/thunno2/__pycache__/tokens.cpython-39.pyc
Binary file not shown.
Binary file removed src/thunno2/__pycache__/version.cpython-311.pyc
Binary file not shown.
Binary file removed src/thunno2/__pycache__/version.cpython-39.pyc
Binary file not shown.
21 changes: 21 additions & 0 deletions src/thunno2/interpreter.py
Original file line number Diff line number Diff line change
Expand Up @@ -576,6 +576,27 @@ def run(code, *, context=None, iteration_index=None):
i += 1
ctx.stack = Stack(copy.deepcopy(list(old_stack).copy()))
ctx.stack.push(r)
elif desc == "first integer":
a = next(ctx.stack.rmv(1))
try:
x = int(a)
except:
x = 1
old_stack = Stack(copy.deepcopy(list(ctx.stack).copy()))
i = x
j = 0
while True:
ctx.stack = Stack(copy.deepcopy(old_stack))
ctx.stack.push(i)
run(info, context=i, iteration_index=j)
k = next(ctx.stack.rmv(1))
if k:
r = i
break
i += sign(x) or 1
j += 1
ctx.stack = Stack(copy.deepcopy(list(old_stack).copy()))
ctx.stack.push(r)
elif desc == "cumulative reduce by":
a = next(ctx.stack.rmv(1))
x = listify(a)
Expand Down
4 changes: 4 additions & 0 deletions src/thunno2/lexer.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,10 @@ def tokenise(code, expected_end=""):
ret.append((y, "3map", r))
elif y == "µq":
ret.append((y, "quit", 0))
elif y == "µƘ":
i, r = tokenise(code[index + 1 :], expected_end=";")
index += i
ret.append((y, "first integer", r))
else:
ret.append((y, "digraph", get_a_function(y)))
except:
Expand Down
2 changes: 1 addition & 1 deletion src/thunno2/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
That's it!
"""

THUNNO_VERSION = "2.2.24"
THUNNO_VERSION = "2.2.25"

0 comments on commit 192686c

Please sign in to comment.