aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/return-0.cup4
-rw-r--r--examples/unary-ops.cup6
2 files changed, 8 insertions, 2 deletions
diff --git a/examples/return-0.cup b/examples/return-0.cup
index 5cc8b30..22d6772 100644
--- a/examples/return-0.cup
+++ b/examples/return-0.cup
@@ -1,3 +1,3 @@
-fn main(): int {
- return 0;
+fn main() {
+ return 0;
} \ No newline at end of file
diff --git a/examples/unary-ops.cup b/examples/unary-ops.cup
new file mode 100644
index 0000000..bdf9853
--- /dev/null
+++ b/examples/unary-ops.cup
@@ -0,0 +1,6 @@
+fn main() {
+ // !!10 -> 1
+ // ~1 -> -2
+ // -(-2) -> 2
+ return -~!!10;
+} \ No newline at end of file