Expand description
The code level for the Quarb query engine.
Cross-language code navigation above the syntax level
(quarb-tree-sitter): function names are node names, not
properties. /lexer/lex/is_name_char descends module,
function, nested function — a filepath into the program —
where the syntax level spells the same question
//function_item[::name = "lex"].
- Names. A declaration’s edge name is its declared
identifier; every other construct in the vocabulary is named
by its normalized keyword (
if,switch,for,call); everything else dissolves — children hoist, as the text level dissolves markup soup. A nameless function-valued expression adopts the identifier of the binding receiving it (const lex = () => {}is a function namedlex). - Traits classify:
<function>,<type>,<module>,<loop>,<conditional>,<call>,<import>. - Properties are uniform:
::signature(the declaration head),::doc(attached documentation),::callee(on calls); bare::is the node’s source text. - Annotations:
::::kind(the raw backend kind — the only place tree-sitter vocabulary survives),::::construct,::::start-line/::::end-line,::::lang,::::n-children,::::n-params— every one aliased to::(the surface is closed; ruling #29). - Crosslinks: every
callcarries->definitionedges to the same-file declarations matching its callee;//lex<-definitionis find-references.
The vocabulary and the per-grammar lowering tables are ruled in the spec (The Code Level, ruling #31) and doubled as conformance fixtures in this crate’s tests. Grammars: Rust, Python, JavaScript, C — the syntax level’s set, each nailed.
Structs§
- Code
Model - A source file read at the code level.
- Decl
- One lowered construct — the code level’s producer seam, the
parallel of
quarb_text::Block. A producer emitsDecls in pre-order (a parent precedes its children);CodeModel::buildderives the arbor. The tree-sitter producer lives in this crate; another backend supplies the same stream and nothing above it moves.
Enums§
Functions§
- lang_
for_ ext - The grammar for a file extension (lowercased).
- supported
- Whether an extension has a code-level lowering (for dispatch
and grafting). Agrees with
quarb_tree_sitter::supported.