Expand description
Typed, read-only wrappers over the BibTeX CST.
Accessors expose syntax without assigning meaning to fields or entries.
Free functions provide the same operations for untyped SyntaxNode callers.
Re-exports§
pub use nodes::Entry;pub use nodes::EntryType;pub use nodes::Field;pub use nodes::FieldName;pub use nodes::Key;pub use nodes::StringEntry;pub use nodes::Value;
Modules§
- nodes
- Typed
AstNodewrappers over the BibTeX CST, with syntactic accessors. The bib analog ofcrate::ast::nodes. Purely syntactic: they know nothing about what a field or entry means (AGENTS.md decisions #2, #10).
Traits§
- AstNode
- A typed wrapper over BibTeX CST nodes of a particular
SyntaxKind.
Functions§
- child
- The first child node castable to
N. - children
- All child nodes castable to
N, in source order. - cite_
key - The cite key of a regular
ENTRYand the byte range of itsKEYnode.Nonewhen the entry has no key (a recovery case) or the key is empty. - entry_
type - The entry type of an
ENTRY/STRING_ENTRY/ … node — the word following@(e.g."article","string").Nonefor a malformed entry with noENTRY_TYPEchild. Case is preserved; callers normalize. - field_
name - The name of a
FIELD(the text of itsFIELD_NAME), orNoneif absent. - field_
value - The
VALUEnode of aFIELD(the right-hand side of=), orNoneif absent. - fields
- The
FIELDchildren of an entry, in source order. - string_
def_ name - The macro name defined by a
STRING_ENTRY(@string{ name = value }) and the byte range of itsFIELD_NAMEnode.Nonefor a malformed@stringwith noname = …field. - value_
macro_ uses - The bare-macro uses inside a
VALUE: eachLITERALpiece whose single token is aWORD(an unquoted, unbraced name) is an@stringreference. ALITERALwrapping aNUMBERis a literal number, not a macro use, and is skipped. Yields(name, range)with the range of theLITERALpiece. - value_
text_ cleaned - A field
VALUEas plain display text: the node text, trimmed, with one layer of surrounding{…}/"…"removed and interior whitespace collapsed. Shared by the LSP hover/completion cards and the semantic model’s cached title/author facts.