aboutsummaryrefslogtreecommitdiff
path: root/src/tokenizer.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/tokenizer.rs')
-rw-r--r--src/tokenizer.rs8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/tokenizer.rs b/src/tokenizer.rs
index 1b80ec3..d272b14 100644
--- a/src/tokenizer.rs
+++ b/src/tokenizer.rs
@@ -1,5 +1,3 @@
-use std::marker::PhantomData;
-
use crate::machine;
use crate::offset::{NoopOffset, Offset, Position};
use crate::reader::{IntoReader, Reader};
@@ -41,16 +39,16 @@ pub struct Tokenizer<R: Reader, O = NoopOffset, E: Emitter<O> = DefaultEmitter<O
pub(crate) emitter: E,
pub(crate) temporary_buffer: String,
pub(crate) reader: R,
- _offset: PhantomData<O>,
to_reconsume: Stack2<Option<char>>,
pub(crate) character_reference_code: u32,
pub(crate) return_state: Option<InternalState>,
current_tag_name: String,
last_start_tag_name: String,
is_start_tag: bool,
+ pub(crate) doctype_offset: O,
}
-impl<R: Reader, O, E: Emitter<O>> Tokenizer<R, O, E> {
+impl<R: Reader, O: Offset, E: Emitter<O>> Tokenizer<R, O, E> {
/// Creates a new tokenizer from some input and an emitter.
///
/// TODO: add warning about you needing to do the state switching
@@ -58,7 +56,6 @@ impl<R: Reader, O, E: Emitter<O>> Tokenizer<R, O, E> {
Tokenizer {
reader: reader.into_reader(),
emitter,
- _offset: PhantomData,
state: InternalState::Data,
to_reconsume: Stack2::default(),
return_state: None,
@@ -68,6 +65,7 @@ impl<R: Reader, O, E: Emitter<O>> Tokenizer<R, O, E> {
current_tag_name: String::new(),
last_start_tag_name: String::new(),
is_start_tag: false,
+ doctype_offset: O::default(),
}
}
}