···1//! HTML5 tokenizer and tree builder.
0000000000000000000000000000000000
···1//! HTML5 tokenizer and tree builder.
2+3+/// A token emitted by the HTML tokenizer.
4+#[derive(Debug, Clone, PartialEq)]
5+pub enum Token {
6+ /// `<!DOCTYPE name public_id system_id>`
7+ Doctype {
8+ name: Option<String>,
9+ public_id: Option<String>,
10+ system_id: Option<String>,
11+ force_quirks: bool,
12+ },
13+ /// `<tag attr="val">`
14+ StartTag {
15+ name: String,
16+ attributes: Vec<(String, String)>,
17+ self_closing: bool,
18+ },
19+ /// `</tag>`
20+ EndTag { name: String },
21+ /// Character data (may be coalesced).
22+ Character(String),
23+ /// `<!-- comment -->`
24+ Comment(String),
25+ /// End of file.
26+ Eof,
27+}
28+29+/// Tokenize an HTML input string into a sequence of tokens.
30+///
31+/// This is a stub that returns an empty `Vec`. The real implementation
32+/// will be a spec-compliant HTML5 tokenizer state machine.
33+pub fn tokenize(_input: &str) -> Vec<Token> {
34+ Vec::new()
35+}