Skip to main content

Module switch

Module switch 

Source
Expand description

This language’s Switch row.

Constants§

CALLABLE
Every kind this row marks callable or callable_when, gates aside.
CHAIN_GATED
Whether any owner carries a gated_by / text_gated_by gate or an opens_by fn that is not marked no_chain, or an under / not_under parent list (#1794) — the row may read the chain it is handed through owns, pays_at_wrapper or the table’s opens_space fold. A forward that hands the row a known-empty chain pins that this stays false (#1793). It says nothing of callable_when, pays_itself_when or a payer’s gate, which only is_callable and pays_at_leaf read.
EXCLUDED
Kinds the row’s author considered and rejected, with why.
LEAF_KINDS
Every kind pays_at_leaf_kind can answer true for, gates aside: the declared payers plus the pays_itself owners on a split row; every owner on a plain row; none under pays never. A consumer that reads several rows’ leaves asserts at build time that two tiers cannot fire on one kind (impl_cyclomatic_rows!, #1697).
OWNERS
Every kind this row declares as owning the construct.
PAYERS
Every kind this row declares as paying for it.
PAYS_NEVER
Whether the construct has owners but no paying node at all.
PROJECT
The field holding an owner’s paying token, where the row declares one.
TEXT_GATED
Whether any owner is text_gated_by — the row reads the bytes it is handed. A consumer that asks the row with none, as the byte-less Checker spellings do while handing the walk’s chain through, pins that this stays false and fails the day it does not, instead of missing the owner.
WRAPS
Interpolation child kinds a StringLit owner can hold.

Functions§

is_callable
Whether node is a callable owner of the construct — a named function, for Checker::is_func — under its gate.
is_callable_kind
is_callable with node’s kind id already read, as owns_kind is to owns.
lists_kind
Whether the row names kind among its owners, gates aside: the byte-less spelling of owns. Spelled as a chain of compares, not OWNERS.contains: <[u16]>::contains is an out-of-line loop over a runtime-length slice, which LLVM cannot fold into the kind switch a consumer dispatches on, while the chain becomes case labels of it (#1697).
owns
Whether node owns the construct.
owns_kind
owns with node’s kind id already read, for a caller that asks several rows about one node: kind_id() is an FFI call per read.
owns_via
Whether node owns the construct through the payer of kind payer: for a consumer that scores only one of a row’s payers (C#’s ?? but not its conditional access), asked of the projection once.
pays_at_leaf
Whether node is the token a counting arm fires on: a declared payer, or an owner that pays for itself. With no pays list the owners are the paying nodes; with pays never, nothing is.
pays_at_leaf_kind
pays_at_leaf with node’s kind id already read.
pays_at_token_kind
Whether node is a declared payer paying for the construct — pays_at_leaf_kind without the pays_itself owners, which pay at the leaf but have no token to bill. What a token-billing consumer (Halstead) reads.
pays_at_wrapper
Whether node is the owning node, for a consumer that pays at the wrapper rather than at its token. Equal to owns unless the row says pays never.
project
The child of an owner that pays for it: the owner’s declared project field, or — where the row declares none, or the grammar gives this owner no such field (Java’s instanceof_expression carries its keyword as a bare child) — its first child whose kind is a declared payer. None when neither holds, which for a declared owner is a row defect.