summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--examples/mathTest.nya13
-rw-r--r--std.c2
2 files changed, 15 insertions, 0 deletions
diff --git a/examples/mathTest.nya b/examples/mathTest.nya
new file mode 100644
index 0000000..280d53d
--- /dev/null
+++ b/examples/mathTest.nya
@@ -0,0 +1,13 @@
+import fn puts(str: [u8]) -> i32;
+
+fn test() -> i32 {
+ const: i32 pog = 5;
+ return pog;
+}
+
+fn main() -> i32 {
+ const: i32 num = 5;
+ const: i32 num2 = test();
+ puts("Hello World!");
+ return num2;
+}
diff --git a/std.c b/std.c
new file mode 100644
index 0000000..67a23c3
--- /dev/null
+++ b/std.c
@@ -0,0 +1,2 @@
+int subtract(int a, int b) { return a - b; }
+int add(int a, int b) { return a + b; }