feat: pattern bindings, empty closures, match-as-expr, string interp

Sessions 10–12 from QUALITY_PLAN:

- Pattern payload bindings (Some(value) => value) in bootstrap and selfhost
- Empty-param closures via || (tkPipePipe) with loop/return bodies
- Expression-form match: let x = match …; newline before arms
- f"…" string interpolation desugared to String_Concat + conversions
- Lexer preserves \{ \} for literal braces in f-strings
- Bootstrap fix: f"plain" strips the f prefix after escape processing
- Examples: pattern_matching, closure_control, match_let, string_interp

Selfhost-loop remains binary-identical; all examples and error goldens pass.
This commit is contained in:
2026-07-18 00:58:44 +03:00
parent f619316470
commit db41ba4d84
18 changed files with 1192 additions and 67 deletions
+3
View File
@@ -228,6 +228,9 @@ proc scanEscapeSequence(lex: var Lexer): string =
of 'r': result = "\r"
of 't': result = "\t"
of '0': result = "\0"
of '{', '}':
# Preserve \{ and \} so f"..." interpolation can treat them as literal braces
result = "\\" & $c
of 'x':
var hexVal = ""
for _ in 0..<2: