pub struct FileSymbols {
pub namespace: Vec<u8>,
pub defines: Vec<Vec<Symbol>>,
pub references: Vec<Vec<Symbol>>,
}Expand description
A file’s symbols, indexed by NEW-SIDE line number.
Both vectors are parallel and one entry per line, so an entry is addressed
by the line number a hunk already carries. Lines with no symbols hold an
empty Vec, which does not allocate — a 100k-line file costs pointers.
Fields§
§namespace: Vec<u8>What these names are written in, as the reader chooses to name it. Two GLOBAL symbols are the same symbol only if their namespaces match as well as their names (ADR 0031).
Opaque to the domain. It is compared and never interpreted, so this still does not tell the graph which reader answered — only whether two answers are about the same body of names. An empty namespace is a namespace like any other, and matches only other empty ones.
defines: Vec<Vec<Symbol>>§references: Vec<Vec<Symbol>>Implementations§
Source§impl FileSymbols
impl FileSymbols
Sourcepub fn defines_at(&self, line: u32) -> &[Symbol]
pub fn defines_at(&self, line: u32) -> &[Symbol]
Symbols defined on line, counting from 1. Empty when out of range.
Sourcepub fn references_at(&self, line: u32) -> &[Symbol]
pub fn references_at(&self, line: u32) -> &[Symbol]
Symbols referenced on line, counting from 1.