summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/mathTest.nya3
-rw-r--r--examples/testif.nya9
2 files changed, 11 insertions, 1 deletions
diff --git a/examples/mathTest.nya b/examples/mathTest.nya
index 14e7f0a..7b36cc8 100644
--- a/examples/mathTest.nya
+++ b/examples/mathTest.nya
@@ -8,8 +8,9 @@ fn test() -> i32 {
fn main() -> i32 {
const: i32 num = 5 + 3 * 7;
const: i32 num2 = test();
- if (num2 == test())
+ if (num2 == test()) {
puts("Hello World!");
+ }
if (num2 == 0)
puts("Shouldn't print");
diff --git a/examples/testif.nya b/examples/testif.nya
new file mode 100644
index 0000000..c18f34e
--- /dev/null
+++ b/examples/testif.nya
@@ -0,0 +1,9 @@
+fn main() -> i32 {
+ if (6 == 7) {
+ return 1;
+ }
+ if (5 == 5) {
+ return 0;
+ }
+ return 2;
+}