From 5bcd9b6beef27cf055214791433cc752f75d4688 Mon Sep 17 00:00:00 2001 From: Mustafa Quraish Date: Fri, 28 Jan 2022 18:53:30 -0500 Subject: Examples: Add example for unary ops, remove type hints We ignore the types for now anyway, so let's just leave them out --- examples/return-0.cup | 4 ++-- examples/unary-ops.cup | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 examples/unary-ops.cup (limited to 'examples') 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 -- cgit v1.2.3