This library is in flux. APIs may change without notice. Generated from source with koruc 0.1.7 on 9/16/2026.
Interpreter.parse
~import std/interpreter.parseKoru Standard Library: the `parse` part of interpreter.kz.
interpreter.parse.kz · 1 tors
Koru Standard Library: the `parse` part of interpreter.kz. · 15 more lines
Koru Standard Library: the `parse` part of interpreter.kz.
Joined via `~part parse` in interpreter.kz; merged into the interpreter
module at load.
Parse WITHOUT executing — the other half of `eval`.
Interpreter source is pure Koru: it has no file, so it has no host half and
no ``. That is why this takes no file name. The full compiler parser
derives its host/pure mode from the filename extension
(`src/parser.zig:707`), so handing it a synthetic name silently answers a
question interpreted source does not have; `flow_parser` has no such notion
and is the only correct parser here.
The returned Flow and every slice it points at are allocated from
`allocator` — the caller owns the AST and may `eval` it as many times as it
likes.
// Koru Standard Library: the `parse` part of interpreter.kz.
// Joined via `~part parse` in interpreter.kz; merged into the interpreter
// module at load.
// Parse WITHOUT executing — the other half of `eval`.
//
// Interpreter source is pure Koru: it has no file, so it has no host half and
// no ``. That is why this takes no file name. The full compiler parser
// derives its host/pure mode from the filename extension
// (`src/parser.zig:707`), so handing it a synthetic name silently answers a
// question interpreted source does not have; `flow_parser` has no such notion
// and is the only correct parser here.
//
// The returned Flow and every slice it points at are allocated from
// `allocator` — the caller owns the AST and may `eval` it as many times as it
// likes.
~[retain] pub tor parse { source: string, allocator: std.mem.Allocator }
| flow *const ast.Flow
| parse-error { message: string, line: u32, column: u32 }