summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorKyle Gunger <kgunger12@gmail.com>2022-04-08 02:20:14 -0400
committerKyle Gunger <kgunger12@gmail.com>2022-04-08 02:20:14 -0400
commit9222a5a73923407f6c0ab2c0d40bb58114b7a6ec (patch)
tree9bc0be024035c2d49a48111b9eaaba3ae44bf7ba /examples
parent2a30bcfb777acab52b4883c6fd44e04ae54b7f8b (diff)
[EVAL] Control Flow
+ Added support for loop and if + Added support for break statements inside CF blocks + Fixed a bug with floats not parsing in specific cases
Diffstat (limited to 'examples')
-rw-r--r--examples/basic.tnsl17
1 files changed, 16 insertions, 1 deletions
diff --git a/examples/basic.tnsl b/examples/basic.tnsl
index 71d784d..b19532f 100644
--- a/examples/basic.tnsl
+++ b/examples/basic.tnsl
@@ -1,3 +1,18 @@
/; main [int]
- ;return 0
+
+ ;int i = 0
+ ;float f = 0.25
+
+ /; loop (i < 2)
+
+ ;i = i + 1
+
+ /; if (f < 1)
+
+ ;i = i + 1
+ ;break
+ ;/
+ ;/
+
+ ;return i
;/