aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorgingerBill <ginger.bill.22@gmail.com>2016-07-21 00:26:14 +0100
committergingerBill <ginger.bill.22@gmail.com>2016-07-21 00:26:14 +0100
commitcbd82e3c02cbeff8fe3ba5198d6ca730f8c1eace (patch)
tree00728d59925609e8fd081f5276e8b26117ec00e3 /examples
parentaa6a2caecb759522914ba82cc506e60270ad1ab0 (diff)
Support import files as modules (i.e. import only once)
Diffstat (limited to 'examples')
-rw-r--r--examples/other.odin3
-rw-r--r--examples/test.odin11
2 files changed, 14 insertions, 0 deletions
diff --git a/examples/other.odin b/examples/other.odin
new file mode 100644
index 000000000..cdea3c675
--- /dev/null
+++ b/examples/other.odin
@@ -0,0 +1,3 @@
+add :: proc(a, b: int) -> int {
+ return a + b;
+}
diff --git a/examples/test.odin b/examples/test.odin
new file mode 100644
index 000000000..c4c966d69
--- /dev/null
+++ b/examples/test.odin
@@ -0,0 +1,11 @@
+import "other"
+
+TAU :: 6.28;
+PI :: PI/2;
+
+main :: proc() {
+ x : int = 2;
+ x = x * 3;
+
+ y := add(1, x);
+}