Expand description
BibTeX parser implementation using winnow
This module provides both high-level and low-level APIs for parsing BibTeX files.
Most users should use the high-level Library API, but the low-level API is available
for advanced use cases that require access to raw parsed items.
§Low-level API Example
use bibtex_parser::parser::{parse_bibtex, ParsedItem};
let input = r#"
@string{ieee = "IEEE"}
@preamble{"Test preamble"}
% Line comment
@article{test2024,
author = "John Doe",
title = ieee # " Article",
year = 2024
}
"#;
let items = parse_bibtex(input)?;
for item in items {
match item {
ParsedItem::Entry(entry) => {
println!("Found entry: {}", entry.key());
// Variables are not expanded yet - title contains reference to 'ieee'
},
ParsedItem::String(name, value) => {
println!("String definition: {} = {:?}", name, value);
},
ParsedItem::Preamble(value) => {
println!("Preamble: {:?}", value);
},
ParsedItem::Comment(text) => {
println!("Comment: {}", text.trim());
},
}
}Re-exports§
pub use entry::parse_entry;
Modules§
- delimiter
- Optimized delimiter finding using memchr
- entry
- Entry parsing for BibTeX
- lexer
- Lexical analysis for BibTeX
- simd
- SIMD-accelerated parsing utilities for BibTeX
- utils
- Parser utilities
- value
- Value parsing for BibTeX fields
Enums§
- Parsed
Item - A raw parsed item from a BibTeX file before processing
Functions§
- parse_
bibtex - Parse a BibTeX file into raw items without expansion or processing
Type Aliases§
- PResult
- Internal parser result type