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, 4 insertions, 4 deletions
diff --git a/src/tokenizer.rs b/src/tokenizer.rs
index 02a4d62..e8a8908 100644
--- a/src/tokenizer.rs
+++ b/src/tokenizer.rs
@@ -106,7 +106,7 @@ impl From<State> for InternalState {
}
}
-impl<R: Reader + Position<O>, O, E: Emitter<O>> Tokenizer<R, O, E> {
+impl<R: Reader + Position<O>, O: Offset, E: Emitter<O>> Tokenizer<R, O, E> {
/// Test-internal function to override internal state.
///
/// Only available with the `integration-tests` feature which is not public API.
@@ -123,7 +123,7 @@ impl<R: Reader + Position<O>, O, E: Emitter<O>> Tokenizer<R, O, E> {
/// Just a helper method for the machine.
#[inline]
pub(crate) fn emit_error(&mut self, error: Error) {
- self.emitter.emit_error(error, self.reader.position());
+ self.emitter.emit_error(error, self.reader.position() - 1);
}
/// Assuming the _current token_ is an end tag, return true if all of these hold. Return false otherwise.
@@ -140,14 +140,14 @@ impl<R: Reader + Position<O>, O, E: Emitter<O>> Tokenizer<R, O, E> {
#[inline]
pub(crate) fn init_start_tag(&mut self) {
- self.emitter.init_start_tag(self.reader.position());
+ self.emitter.init_start_tag(self.reader.position() - 1);
self.current_tag_name.clear();
self.is_start_tag = true;
}
#[inline]
pub(crate) fn init_end_tag(&mut self) {
- self.emitter.init_end_tag(self.reader.position());
+ self.emitter.init_end_tag(self.reader.position() - 1);
self.current_tag_name.clear();
self.is_start_tag = false;
}