Expand description
Core AST infrastructure: arena-backed ParsedDoc, span utilities, and TypeHint formatting.
Convention: a borrowed SourceView is idiomatically bound to sv across
the crate (offset↔position math). A ParsedDoc value is doc. See the
crate-root glossary in lib.rs.
Structs§
- Parsed
Doc - Owns a parsed PHP document: the bumpalo arena, source snapshot, and Program.
- Source
View - Bundles source text with its precomputed line-start table.
Copyso inner functions can pass it by value without lifetime annotation churn.
Functions§
- format_
type_ hint - Format a
TypeHintas a PHP type string, e.g.?int,string|null. - name_
range - Build an LSP
Rangefor a name that is a sub-slice ofsource, or None if not found. - offset_
to_ position - Convert a byte offset into
sourceto an LSPPosition(0-based line/char). - span_
to_ range - Convert a
Span(byte-offset pair) to an LSPRange. - str_
offset - Return the byte offset of
substrwithinsource, or None if not found. - str_
offset_ in_ range - Find a name within a specific byte range of the source, with word-boundary matching. Returns the absolute byte offset if found, None otherwise.