From 22bdec47201c5cf17dc450d2be71f231bee1168b Mon Sep 17 00:00:00 2001
From: Vardan Petrosyan <petrosyanvardan2009@gmail.com>
Date: Wed, 29 May 2024 19:44:58 +0400
Subject: [PATCH 1/2] fix: Integer division issue

Closes #96
---
 core/datatypes.py | 3 +--
 core/parser.py    | 2 +-
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/core/datatypes.py b/core/datatypes.py
index b323990..e2376df 100755
--- a/core/datatypes.py
+++ b/core/datatypes.py
@@ -196,8 +196,7 @@ def idived_by(self, other: Value) -> ResultTuple:
         if isinstance(other, Number):
             if other.value == 0:
                 return None, RTError(other.pos_start, other.pos_end, "Division by zero", self.context)
-
-            return Number(self.value // other.value).set_context(self.context), None
+            return Number(int(self.value // other.value)).set_context(self.context), None
         else:
             return None, Value.illegal_operation(self, other)
 
diff --git a/core/parser.py b/core/parser.py
index a9b5b69..7d7cf32 100755
--- a/core/parser.py
+++ b/core/parser.py
@@ -478,7 +478,7 @@ def arith_expr(self) -> ParseResult[Node]:
         return self.bin_op(self.term, (TT_PLUS, TT_MINUS))
 
     def term(self) -> ParseResult[Node]:
-        return self.bin_op(self.factor, (TT_MUL, TT_DIV, TT_MOD))
+        return self.bin_op(self.factor, (TT_MUL, TT_DIV, TT_MOD, TT_IDIV))
 
     def factor(self) -> ParseResult[Node]:
         res = ParseResult[Node]()

From b026b7960cb2b7cd1162205c516aef21c8870f4d Mon Sep 17 00:00:00 2001
From: Vardan Petrosyan <petrosyanvardan2009@gmail.com>
Date: Wed, 29 May 2024 19:47:40 +0400
Subject: [PATCH 2/2] update tests

---
 tests/incdec.rn.json | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/incdec.rn.json b/tests/incdec.rn.json
index a61a1e2..eaa8b91 100644
--- a/tests/incdec.rn.json
+++ b/tests/incdec.rn.json
@@ -1 +1 @@
-{"code": 0, "stdout": "69\n70\n69\n69\n70\n71\n72\n71\n70\n----------------\n69 69\n69 70\n----------------\n69\n74\n69\n345\n69.0\n1564031349.0\n312806269.0\n4.0\n", "stderr": ""}
\ No newline at end of file
+{"code": 0, "stdout": "69\n70\n69\n69\n70\n71\n72\n71\n70\n----------------\n69 69\n69 70\n----------------\n69\n74\n69\n345\n69.0\n1564031349.0\n312806269\n4\n", "stderr": ""}
\ No newline at end of file