Expand description
The BibTeX/BibLaTeX parser: lexer, event-stream parser, and green-tree builder.
A sibling of crate::parser, built on the same lossless rowan CST + flat
event-stream architecture but for .bib files, which are a distinct grammar
with their own syntax::SyntaxKind and syntax::BibLang marker. The
pipeline follows rust-analyzer: lex produces a flat token stream,
the parser emits a flat list of [events::Event]s, and
[tree_builder::build_tree] turns tokens + events into a rowan green tree.
This is the parser layer only; the .bib formatter lives in the
badness-formatter crate, and the linter and LSP integration in the
badness crate.
Re-exports§
pub use core::Parse;pub use core::SyntaxError;pub use core::parse;pub use core::reconstruct;pub use lexer::Token;pub use lexer::lex;
Modules§
- ast
- A typed AST layer over the BibTeX CST — the bib analog of
crate::ast. Thin, read-only wrappers (AstNode) giving nodes a typed identity and syntactic accessors (an entry’s type and cite key, its fields’ names and values, an@stringdefinition’s name, the bare macro uses inside a value). - core
- The BibTeX parser entry point and its output type.
- lexer
- A total, lossless lexer for BibTeX/BibLaTeX surface syntax.
- semantic
- Single-file BibTeX semantic analysis: the per-file entry / cite-key /
@stringmodel. - syntax
SyntaxKind— the kinds of CST tokens and nodes — and the rowanLanguagebinding for badness’s BibTeX/BibLaTeX surface CST.