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
//! CSS Syntax Level 3 tokenizer and parser with CSS Nesting support.
//!
//! MIT/Apache-2.0 licensed. Part of the browser_oxide project.
//!
//! This crate provides:
//! - A zero-copy **tokenizer** per CSS Syntax §4
//! - A **parser** per CSS Syntax §5 with CSS Nesting Module support
//! - Source location tracking on all AST nodes
//! - Error-tolerant parsing (collects errors, always produces a best-effort AST)
//!
//! # Example
//!
//! ```
//! use browser_oxide::css_parser::{parse_stylesheet, parse_declaration_list};
//!
//! let (stylesheet, errors) = parse_stylesheet("h1 { color: red; }");
//! assert!(errors.is_empty());
//! assert_eq!(stylesheet.rules.len(), 1);
//!
//! let (decls, _) = parse_declaration_list("color: red; font-size: 16px");
//! assert_eq!(decls.len(), 2);
//! ```
pub use *;
pub use ParseError;
pub use Parser;
pub use SourceLocation;
pub use ;
pub use Tokenizer;
/// Parse a complete CSS stylesheet.
///
/// Returns the parsed stylesheet and any non-fatal parse errors.
/// Parse a list of CSS declarations (e.g., from a `style` attribute).
///
/// Returns the parsed declarations and any non-fatal parse errors.