aboutsummaryrefslogtreecommitdiff
path: root/examples/hello2.sloth
diff options
context:
space:
mode:
authorCody <cody@codyq.dev>2023-06-23 22:01:38 -0500
committerCody <cody@codyq.dev>2023-06-23 22:01:38 -0500
commita8b21ebd34aa2d1d750eecc22f3f252c04198fd0 (patch)
treef239ce3dc8f698ecd350a32743c52ea0a96af4c5 /examples/hello2.sloth
parent3bceb8ff306775a4204063de765cce730a31ffb2 (diff)
downloadsloth-a8b21ebd34aa2d1d750eecc22f3f252c04198fd0.tar.gz
Integrated symbol tables into AST
Diffstat (limited to 'examples/hello2.sloth')
-rw-r--r--examples/hello2.sloth11
1 files changed, 11 insertions, 0 deletions
diff --git a/examples/hello2.sloth b/examples/hello2.sloth
new file mode 100644
index 0000000..589d969
--- /dev/null
+++ b/examples/hello2.sloth
@@ -0,0 +1,11 @@
+fn example() {}
+
+fn main() {
+ var i: Int = 10;
+ var j: Int = 1.0 - 1;
+ while i > j {
+ i = i - 1;
+ }
+ example(i);
+}
+