aboutsummaryrefslogtreecommitdiff
path: root/src/main/resources/python
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/resources/python')
-rw-r--r--src/main/resources/python/runtime/_couscous.py4
-rw-r--r--src/main/resources/python/runtime/java/lang/Boolean.py13
-rw-r--r--src/main/resources/python/runtime/java/lang/Integer.py6
3 files changed, 23 insertions, 0 deletions
diff --git a/src/main/resources/python/runtime/_couscous.py b/src/main/resources/python/runtime/_couscous.py
index 70d9a97..aa108a5 100644
--- a/src/main/resources/python/runtime/_couscous.py
+++ b/src/main/resources/python/runtime/_couscous.py
@@ -1,4 +1,5 @@
from .java.lang.Integer import Integer
+from .java.lang.Boolean import Boolean
def _div_round_to_zero(a, b):
@@ -9,3 +10,6 @@ def _mod_round_to_zero(a, b):
def boxInt(value):
return Integer(value)
+
+def boxBoolean(value):
+ return Boolean(value) \ No newline at end of file
diff --git a/src/main/resources/python/runtime/java/lang/Boolean.py b/src/main/resources/python/runtime/java/lang/Boolean.py
new file mode 100644
index 0000000..6e08f29
--- /dev/null
+++ b/src/main/resources/python/runtime/java/lang/Boolean.py
@@ -0,0 +1,13 @@
+class Boolean(object):
+ def __init__(self, value):
+ self._value = value
+
+ def equals(self, other):
+ # TODO: test this properly
+ return isinstance(other, Boolean) and other._value == self._value
+
+ def __str__(self):
+ return str(self._value)
+
+ def __repr__(self):
+ return str(self) \ No newline at end of file
diff --git a/src/main/resources/python/runtime/java/lang/Integer.py b/src/main/resources/python/runtime/java/lang/Integer.py
index e16e7bb..8ea30a4 100644
--- a/src/main/resources/python/runtime/java/lang/Integer.py
+++ b/src/main/resources/python/runtime/java/lang/Integer.py
@@ -9,3 +9,9 @@ class Integer(object):
def equals(self, other):
# TODO: test this properly
return isinstance(other, Integer) and other._value == self._value
+
+ def __str__(self):
+ return str(self._value)
+
+ def __repr__(self):
+ return str(self) \ No newline at end of file