049 runtime run lenient

✓ Passing This code compiles and runs correctly.

Code

// Test: std.runtime:run can opt into lenient parsing

~import "$std/runtime"
~import "$std/io"

const std = @import("std");

~pub event ping {}
| ok {}

~proc ping {
    std.debug.print("PING\n", .{});
    return .{ .ok = .{} };
}

~std.runtime:register(scope: "api") {
    ping(1)
}

const TEST_SOURCE =
    \\~event broken
    \\| ok {}
    \\~ping()
;

~std.runtime:run(source: TEST_SOURCE, scope: "api", fail_fast: false)
| result _ |> std.io:print.ln("OK")
| exhausted _ |> std.io:print.ln("EXHAUSTED")
| parse_error _ |> std.io:print.ln("PARSE ERROR")
| validation_error _ |> std.io:print.ln("VALIDATION ERROR")
| event_denied _ |> std.io:print.ln("EVENT DENIED")
| dispatch_error _ |> std.io:print.ln("DISPATCH ERROR")
| scope_not_found _ |> std.io:print.ln("SCOPE NOT FOUND")
input.kz

Expected Output

PING
OK

Test Configuration

MUST_RUN