aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main/java/org/zwobble/couscous/backends/python/PythonCodeGenerator.java3
-rw-r--r--src/main/resources/python/runtime/_couscous.py8
2 files changed, 3 insertions, 8 deletions
diff --git a/src/main/java/org/zwobble/couscous/backends/python/PythonCodeGenerator.java b/src/main/java/org/zwobble/couscous/backends/python/PythonCodeGenerator.java
index 47b007b..2320a5a 100644
--- a/src/main/java/org/zwobble/couscous/backends/python/PythonCodeGenerator.java
+++ b/src/main/java/org/zwobble/couscous/backends/python/PythonCodeGenerator.java
@@ -266,9 +266,10 @@ public class PythonCodeGenerator {
public PythonExpressionNode visit(TypeCoercionNode typeCoercion) {
PythonExpressionNode value = generateExpression(typeCoercion.getExpression());
if (isIntegerBox(typeCoercion)) {
+ // TODO: replace with direct access to java.lang.Integer
return internalMethod("boxInt", asList(value));
} else if (isIntegerUnbox(typeCoercion)) {
- return internalMethod("unboxInt", asList(value));
+ return pythonAttributeAccess(value, "_value");
} else {
return value;
}
diff --git a/src/main/resources/python/runtime/_couscous.py b/src/main/resources/python/runtime/_couscous.py
index 8d92f8e..b8ab6fd 100644
--- a/src/main/resources/python/runtime/_couscous.py
+++ b/src/main/resources/python/runtime/_couscous.py
@@ -9,10 +9,4 @@ def _mod_round_to_zero(a, b):
return -(-a % b) if (a < 0) ^ (b < 0) else a % b
def boxInt(value):
- return Integer(value)
-
-def unboxInt(value):
- return value._value
-
-def boxBoolean(value):
- return Boolean(value) \ No newline at end of file
+ return Integer(value) \ No newline at end of file