Add support for block-style if/else and while loop statements with tests

This commit is contained in:
Stone_Red
2026-03-04 14:28:04 +01:00
parent 9d43f1373f
commit 299558df70
3 changed files with 349 additions and 12 deletions
+20 -12
View File
@@ -19,18 +19,6 @@ This document describes the current, word-based YesNt syntax.
## Quick Example
v1:
```ynt
<name = world
fnc greet
cwl Hello >name
ret
cal greet
```
v2:
```ynt
let name = world
func greet:
@@ -39,6 +27,26 @@ return
call greet
```
## Block Conditionals
```ynt
if 10 > 5:
print_line yes
else:
print_line no
end_if
```
## While Loops
```ynt
let i = 3
while ${i} > 0:
print_line ${i}
let i = ${i} - 1 calc
end_while
```
## Full v1 -> v2 Mapping
| Area | v1 Syntax | v2 Syntax | Notes |