mirror of
https://github.com/Stone-Red-Code/YesNt-Interpreter.git
synced 2026-09-04 00:56:31 +02:00
Add support for block-style if/else and while loop statements with tests
This commit is contained in:
+20
-12
@@ -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 |
|
||||
|
||||
Reference in New Issue
Block a user