Skip to main content

Module bib

Module bib 

Source
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
Typed, read-only wrappers over the BibTeX CST.
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.
syntax
SyntaxKind — the kinds of CST tokens and nodes — and the rowan Language binding for badness’s BibTeX/BibLaTeX surface CST.