Expand description
Cursor-constructor sugar registry.
A cursor sugar lets a node module (vectordata, future
tabular sources, etc.) recognize a non-standard cursor x = foo(...) form and rewrite it into:
- A synthetic constructor expression (typically
range(...)) that the standard extent-resolution path can drive, and - Zero or more auxiliary bindings to emit after the cursor’s
input ports are wired — typical examples are an
init-time prebuffer call and per-field projection bindings
(
<cursor>__vector := vector_at("ds:profile", <cursor>__ordinal)).
The core compiler stays agnostic: it walks the inventory of
registered handlers, picks the first match, and applies the
rewrite. Adding a new sugar form is a single
inventory::submit! plus a handler function — no compile.rs
change required.
Structs§
- AuxBinding
- One binding emitted by sugar after cursor input wiring.
- Cursor
Sugar - The rewrite returned by a sugar handler.
- Cursor
Sugar Registration - One inventory entry. Handlers self-name for diagnostic
listings (
describe wiring cursor-sugar, future) and so the dispatcher can attribute errors to the right module.
Functions§
- dispatch
- Walk the inventory and dispatch to the first handler that
matches
constructor. Returns the rewrite to apply,Noneif no handler matches, or the handler’s error.
Type Aliases§
- Cursor
Sugar Fn - A handler that recognizes one or more cursor-constructor
shapes and produces a
CursorSugarrewrite. Return: