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:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user