pub struct StaticChunk { /* private fields */ }Expand description
One compile, flat and immutable: see the module documentation.
Implementations§
Source§impl StaticChunk
impl StaticChunk
pub fn node(&self, id: NodeId) -> Node
pub fn pat(&self, id: PatId) -> Pat
pub fn lambda(&self, id: LambdaId) -> &Lambda
pub fn module(&self, id: ModId) -> &Module
Sourcepub fn members(&self, module: &Module) -> &[Member]
pub fn members(&self, module: &Module) -> &[Member]
A module’s member index space (see Module::members).
Sourcepub fn frame_names(&self, module: &Module) -> &[Sym]
pub fn frame_names(&self, module: &Module) -> &[Sym]
A module’s frame slot names.
Sourcepub fn imports(&self, module: &Module) -> &[ImportSpec]
pub fn imports(&self, module: &Module) -> &[ImportSpec]
A module’s import specs.
pub fn int(&self, id: IntId) -> &BigInt
pub fn str(&self, id: StrId) -> &Text
Sourcepub fn nodes(&self, run: Run, first: NodeId, len: u32) -> &[Node]
pub fn nodes(&self, run: Run, first: NodeId, len: u32) -> &[Node]
The len nodes of a run of kind run, starting at first.
Sourcepub fn pats(&self, run: Run, first: PatId, len: u32) -> &[Pat]
pub fn pats(&self, run: Run, first: PatId, len: u32) -> &[Pat]
The len patterns of a run of kind run, starting at first.
Sourcepub fn module_ids(&self) -> impl Iterator<Item = ModId> + Clone
pub fn module_ids(&self) -> impl Iterator<Item = ModId> + Clone
The ids of the chunk’s modules, the top module first.
Sourcepub fn member(&self, m: ModId, index: u32) -> Option<Member>
pub fn member(&self, m: ModId, index: u32) -> Option<Member>
The item or local at index of module m’s member space, or None
past them, where the iotas are.
Sourcepub fn member_len(&self, m: ModId) -> u32
pub fn member_len(&self, m: ModId) -> u32
How many items and locals module m has: the size of its id block,
and where its iotas start.
Sourcepub fn iota(&self, m: ModId, index: u32) -> Option<Sym>
pub fn iota(&self, m: ModId, index: u32) -> Option<Sym>
The name of iota index of module m, counted from its first iota.
Sourcepub fn index_of(&self, m: ModId, name: Sym) -> Option<u32>
pub fn index_of(&self, m: ModId, name: Sym) -> Option<u32>
The index of module m’s item name, searched by Sym. Locals are
not searched: they are private.
Sourcepub fn item_names(&self, m: ModId) -> impl Iterator<Item = Sym> + '_
pub fn item_names(&self, m: ModId) -> impl Iterator<Item = Sym> + '_
Module m’s item names, sorted by Sym: its public listing.
Sourcepub fn local_names(&self, m: ModId) -> impl Iterator<Item = Sym> + '_
pub fn local_names(&self, m: ModId) -> impl Iterator<Item = Sym> + '_
Module m’s local names, sorted by Sym. Locals are unreachable
as M.name from outside; this is for host introspection.
Sourcepub fn iota_names(&self, m: ModId) -> impl Iterator<Item = Sym> + '_
pub fn iota_names(&self, m: ModId) -> impl Iterator<Item = Sym> + '_
Module m’s iota names, sorted by Sym.
Source§impl StaticChunk
impl StaticChunk
Source§impl StaticChunk
impl StaticChunk
Source§impl StaticChunk
impl StaticChunk
Sourcepub fn documents(&self) -> &[Doc]
pub fn documents(&self) -> &[Doc]
The documents this chunk was parsed from, in order. The prelude chunk has none.
Sourcepub fn node_ids(&self) -> impl Iterator<Item = NodeId>
pub fn node_ids(&self) -> impl Iterator<Item = NodeId>
The ids of the chunk’s nodes, in table order, debug barriers included.
Sourcepub fn pat_ids(&self) -> impl Iterator<Item = PatId>
pub fn pat_ids(&self) -> impl Iterator<Item = PatId>
The ids of the chunk’s patterns, as node_ids.
Sourcepub fn lambda_ids(&self) -> impl Iterator<Item = LambdaId>
pub fn lambda_ids(&self) -> impl Iterator<Item = LambdaId>
The ids of the chunk’s lambdas, in table order.
Sourcepub fn node_span(&self, id: NodeId) -> Option<ChunkSpan>
pub fn node_span(&self, id: NodeId) -> Option<ChunkSpan>
The span of node id, if it was parsed.
Sourcepub fn pat_span(&self, id: PatId) -> Option<ChunkSpan>
pub fn pat_span(&self, id: PatId) -> Option<ChunkSpan>
The span of pattern id, if it was parsed.
Sourcepub fn lambda_span(&self, id: LambdaId) -> Option<ChunkSpan>
pub fn lambda_span(&self, id: LambdaId) -> Option<ChunkSpan>
The span of lambda id: its whole &, with the parameters.