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:
@@ -0,0 +1,23 @@
|
||||
import Std::Io::{PrintLine};
|
||||
import Std::Test::{Test_AssertEqString, Test_Pass};
|
||||
|
||||
func Main() -> int {
|
||||
let name: String = "Bux";
|
||||
let n: int = 42;
|
||||
let msg: String = f"Hello, {name}! count={n}";
|
||||
PrintLine(msg);
|
||||
Test_AssertEqString(msg, "Hello, Bux! count=42");
|
||||
|
||||
let flag: bool = true;
|
||||
let bmsg: String = f"flag={flag}";
|
||||
Test_AssertEqString(bmsg, "flag=true");
|
||||
|
||||
let empty: String = f"plain";
|
||||
Test_AssertEqString(empty, "plain");
|
||||
|
||||
let raw: String = f"use \{braces\} literally";
|
||||
Test_AssertEqString(raw, "use {braces} literally");
|
||||
|
||||
Test_Pass("string_interp");
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user