phase: 20.49 COMPLETE; 20.50 Flow+String minimal reps; 20.51 selfhost v0/v1 minimal (Option A/B); hv1-inline binop/unop/copy; docs + run_all + CURRENT_TASK -> 21.0
This commit is contained in:
21
apps/tests/block_postfix_catch_basic.hako
Normal file
21
apps/tests/block_postfix_catch_basic.hako
Normal file
@ -0,0 +1,21 @@
|
||||
// Block‑postfix catch sample (Stage‑3 gated)
|
||||
// Enable: NYASH_PARSER_STAGE3=1 (or NYASH_BLOCK_CATCH=1) + NYASH_TRY_RESULT_MODE=1 for JSON v0 Bridge
|
||||
|
||||
function main() {
|
||||
local y
|
||||
y = 0
|
||||
|
||||
{
|
||||
// try body
|
||||
// do_something_dangerous()
|
||||
throw "E"
|
||||
} catch (e) {
|
||||
// handle error
|
||||
y = 42
|
||||
} cleanup {
|
||||
// cleanup
|
||||
y = y + 1
|
||||
}
|
||||
|
||||
return y
|
||||
}
|
||||
Reference in New Issue
Block a user