From 2306420c3b2e2928c0d6afe65ce46aa854341d03 Mon Sep 17 00:00:00 2001 From: schaeff Date: Wed, 24 Mar 2021 15:37:38 +0100 Subject: [PATCH] add compile errors --- zokrates_cli/examples/compile_errors/double_negation.zok | 3 +++ zokrates_cli/examples/compile_errors/double_power.zok | 3 +++ zokrates_core_test/tests/tests/precedence.zok | 1 + 3 files changed, 7 insertions(+) create mode 100644 zokrates_cli/examples/compile_errors/double_negation.zok create mode 100644 zokrates_cli/examples/compile_errors/double_power.zok diff --git a/zokrates_cli/examples/compile_errors/double_negation.zok b/zokrates_cli/examples/compile_errors/double_negation.zok new file mode 100644 index 00000000..257892a8 --- /dev/null +++ b/zokrates_cli/examples/compile_errors/double_negation.zok @@ -0,0 +1,3 @@ +def main(): + field a = - - 1 + return \ No newline at end of file diff --git a/zokrates_cli/examples/compile_errors/double_power.zok b/zokrates_cli/examples/compile_errors/double_power.zok new file mode 100644 index 00000000..43443699 --- /dev/null +++ b/zokrates_cli/examples/compile_errors/double_power.zok @@ -0,0 +1,3 @@ +def main(): + field a = 1**2**3 // parentheses are required here + return \ No newline at end of file diff --git a/zokrates_core_test/tests/tests/precedence.zok b/zokrates_core_test/tests/tests/precedence.zok index e3ed0cfa..fcc1e9e8 100644 --- a/zokrates_core_test/tests/tests/precedence.zok +++ b/zokrates_core_test/tests/tests/precedence.zok @@ -14,6 +14,7 @@ def main(): assert(0x00 ^ 0x00 == 0x00) assert(0 - 2 ** 2 == -4) + assert(-2**2 == -4) //check if all statements have evalutated to true assert(a * b * c * d * e * f == 1)