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
//! Pure-Rust ASS/SSA script engine. First slice: the script parser.
//!
//! This is the input layer of the pure-Rust subtitle renderer that will
//! implement [`super::backend::SubtitleRenderer`] without linking libass.
//! Parsing is a faithful port of libass 0.17.1 (`ass.c`), preserving its
//! VSFilter-compatible behavior on purpose, including the quirks:
//!
//! - numbers wrap modulo 2^32, `&H`/`0x` prefixes select hex, trailing junk
//! is ignored, invalid values parse as 0;
//! - the styles list always starts with a built-in `Default` style; style
//! lookups search backwards and fall back to the default style;
//! - `Format:` lines drive field order; unknown fields are skipped; short
//! lines keep defaults; `Text` swallows the raw rest of the line;
//! - SSA scripts get the VSFilter fixups (BackColour → OutlineColour,
//! AlphaLevel, alignment remaps), ASS alignments are numpad-converted;
//! - custom format lines and legacy FFmpeg-converted scripts default
//! `ScaledBorderAndShadow` to yes;
//! - unknown section headers do NOT switch sections (their lines bleed
//! into the current one), parsing stops at the first NUL byte, and BOMs
//! at line starts are skipped.
//!
//! Semantics were verified against the libass sources function by function
//! (`process_text` / `process_line` / `process_style` /
//! `process_event_tail` / `ass_process_force_style` / `decode_font`);
//! resolution defaulting and rendering-time behavior are deliberately NOT
//! part of the parser — they belong to the renderer.
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;