Add string literal parsing with escapes and related tests

This commit is contained in:
Stone_Red
2026-03-04 16:21:49 +01:00
parent 7f58fb4aaf
commit 86819900a0
3 changed files with 152 additions and 0 deletions
+3
View File
@@ -14,6 +14,8 @@ This document describes the current, word-based YesNt syntax.
- Statements are line-based.
- `# ...` remains a comment.
- Variable interpolation inside text uses `${name}`.
- String literals use double quotes (`"..."`) with escapes like `\n`, `\t`, `\"`, `\\`.
Interpolation is not evaluated inside string literals.
- Function and label declarations are block markers with a trailing `:`.
- Conditions retain current evaluator expressions (for example: `a == b`, `x > 5`, `10 + 2 == 12`).
@@ -22,6 +24,7 @@ This document describes the current, word-based YesNt syntax.
```ynt
var name = world
func greet:
print_line "Hello world"
print_line Hello ${name}
return
call greet