1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
//! LaTeX syntax correction layer.
//!
//! This module provides a correction layer for LaTeX documents, filtering and
//! repairing lattice paths based on LaTeX grammar rules.
//!
//! # Features
//!
//! - CFG-based filtering for LaTeX document structure
//! - Environment begin/end matching
//! - Brace and delimiter balancing
//! - Math mode validation
//! - Syntax repair suggestions
//!
//! # Architecture
//!
//! The LaTeX layer uses a multi-pass approach:
//!
//! 1. **Grammar Filtering**: Uses Earley parsing to filter paths that don't
//! conform to LaTeX grammar.
//!
//! 2. **Structural Validation**: Checks begin/end pairing, brace matching,
//! and delimiter balance.
//!
//! 3. **Repair Generation**: For invalid paths, generates repair suggestions
//! (insert/delete/replace) that would make them valid.
//!
//! # Example
//!
//! ```ignore
//! use lling_llang::layers::latex::{LatexSyntaxLayer, LatexGrammar};
//!
//! let grammar = LatexGrammar::standard();
//! let layer = LatexSyntaxLayer::new(grammar);
//!
//! let corrected = layer.apply(&lattice)?;
//! ```
pub use ;
pub use ;
pub use ;
pub use ;