This library is in flux. APIs may change without notice. Generated from source with koruc 0.1.7 on 8/19/2026.
Koru
~import std/koruParser Wrapper - Koru Events for Parser Zig Library
koru.kz · 2 tors
Parser Wrapper - Koru Events for Parser Zig Library
Makes the Zig parser available as Koru events at RUNTIME.
Usage:
import std/koru
std/koru:parse.source(source: code, file-name: "test.kz", allocator: allocator)
| parsed p |> use(p.ast)
| parse-error e |> handle(e.message)
This enables:
- REPLs that parse and execute Koru at runtime
- Wire protocols that accept Koru as input
- Dynamic code loading and evaluation
- AI agents that can parse and understand Koru
parse.source
koru_std/koru.kz:169// PARSER EVENTS
//
// Parse Koru source code into AST
~pub tor parse.source {
source: string,
file_name: string,
allocator: std.mem.Allocator
}
| parsed parser_impl.ParseResult
| parse-error stringdump.ast
koru_std/koru.kz:193// Serialize AST to JSON string
~pub tor dump.ast { ast: parser_impl.ParseResult, allocator: std.mem.Allocator }
| dumped string
| dump-error string