diff --git a/src/main/kotlin/org/serenityos/jakt/comptime/Interpreter.kt b/src/main/kotlin/org/serenityos/jakt/comptime/Interpreter.kt index 848d9a6..1e20f03 100644 --- a/src/main/kotlin/org/serenityos/jakt/comptime/Interpreter.kt +++ b/src/main/kotlin/org/serenityos/jakt/comptime/Interpreter.kt @@ -394,6 +394,7 @@ class Interpreter(element: JaktPsiElement) { is JaktTupleExpression -> ExecutionResult.Normal(TupleValue(element.expressionList.map { e -> evaluateNonYield(e) { return it } }.toMutableList())) + is JaktParenExpression -> evaluate(element.expression!!) /*** STATEMENTS ***/ diff --git a/src/test/kotlin/org/serenityos/jakt/comptime/JaktBasicComptimeTest.kt b/src/test/kotlin/org/serenityos/jakt/comptime/JaktBasicComptimeTest.kt new file mode 100644 index 0000000..cdff0a1 --- /dev/null +++ b/src/test/kotlin/org/serenityos/jakt/comptime/JaktBasicComptimeTest.kt @@ -0,0 +1,18 @@ +package org.serenityos.jakt.comptime + +class JaktBasicComptimeTest : JaktComptimeTest() { + fun `test bitwise operators`() = doStdoutTest(""" + comptime bitwise() { + if (((0x123 ^ 0x456) << 12) | (0x789 & 0xabc)) == 0x575288 { + print("PASS") + } else { + print("FAIL") + } + } + + function main() { + bitwise() + //^T + } + """.trimIndent(), "PASS") +}