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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
//! Streaming and incremental parsing for ASS scripts
//!
//! Provides efficient streaming parsing capabilities with true incremental
//! processing through state machine design. Enables <5ms responsiveness
//! for large files and editor integration.
//!
//! # Features
//!
//! - True streaming: Process chunks without loading entire file
//! - State machine: Handle partial lines and incomplete sections
//! - Delta tracking: Efficient change representation for editors
//! - Memory efficiency: O(line) not O(file) memory usage
//!
//! # Performance
//!
//! - Target: <5ms per 1MB chunk processing
//! - Memory: <1.1x input size peak usage
//! - Incremental: <2ms for single-event edits
//! - Supports files up to 2GB on 64-bit systems
//!
//! # Example
//!
//! ```rust
//! use ass_core::parser::streaming::StreamingParser;
//!
//! let mut parser = StreamingParser::new();
//!
//! // Process chunks incrementally
//! let chunk1 = b"[Script Info]\nTitle: Example\n";
//! let deltas1 = parser.feed_chunk(chunk1)?;
//!
//! let chunk2 = b"[Events]\nFormat: Layer, Start, End\n";
//! let deltas2 = parser.feed_chunk(chunk2)?;
//!
//! let result = parser.finish()?;
//! # Ok::<(), Box<dyn std::error::Error>>(())
//! ```
extern crate alloc;
// Re-export public API
pub use ;
pub use StreamingParser;
pub use LineProcessor;
pub use StreamingResult;
pub use build_modified_source;
pub use ;