db41ba4d84
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.
24 lines
623 B
Plaintext
24 lines
623 B
Plaintext
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;
|
|
}
|