use std::collections::VecDeque; use std::ops::Range; use crate::offset::Offset; use crate::Emitter; use crate::Error; use crate::Token; /// An [`Emitter`] implementation that yields [`Token`]. pub struct BasicEmitter { errors: VecDeque<(Error, Range)>, } impl Default for BasicEmitter { fn default() -> Self { BasicEmitter { errors: VecDeque::new(), } } } impl BasicEmitter { /// Removes all encountered tokenizer errors and returns them as an iterator. pub fn drain_errors(&mut self) -> impl Iterator)> + '_ { self.errors.drain(0..) } } impl Iterator for BasicEmitter { type Item = Token; fn next(&mut self) -> Option { todo!() } } #[allow(unused_variables)] impl Emitter for BasicEmitter { fn report_error(&mut self, error: Error, span: Range) { todo!() } fn emit_char(&mut self, c: char) { todo!() } fn emit_eof(&mut self) { todo!() } fn init_start_tag(&mut self, tag_offset: O, name_offset: O) { todo!() } fn init_end_tag(&mut self, tag_offset: O, name_offset: O) { todo!() } fn push_tag_name(&mut self, s: &str) { todo!() } fn init_attribute_name(&mut self, offset: O) { todo!() } fn push_attribute_name(&mut self, s: &str) { todo!() } fn push_attribute_value(&mut self, s: &str) { todo!() } fn set_self_closing(&mut self, slash_span: Range) { todo!() } fn emit_current_tag(&mut self, offset: O) { todo!() } fn init_comment(&mut self, data_start_offset: O) { todo!() } fn push_comment(&mut self, s: &str) { todo!() } fn emit_current_comment(&mut self, data_end_offset: O) { todo!() } fn init_doctype(&mut self, offset: O) { todo!() } fn push_doctype_name(&mut self, s: &str) { todo!() } fn init_doctype_public_id(&mut self, offset: O) { todo!() } fn push_doctype_public_id(&mut self, s: &str) { todo!() } fn init_doctype_system_id(&mut self, offset: O) { todo!() } fn push_doctype_system_id(&mut self, s: &str) { todo!() } fn set_force_quirks(&mut self) { todo!() } fn emit_current_doctype(&mut self, offset: O) { todo!() } }