summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Fischer <martin@push-f.com>2023-08-28 05:40:49 +0200
committerMartin Fischer <martin@push-f.com>2023-09-03 23:00:05 +0200
commitf2ff370d7b9920c89bcc50cf35b7cd5bc4d2c777 (patch)
tree910959c38d9d744ed82d4204b383d8ceb559c873
parent7cd148aa33a0de7ae5629a51db9157f66db9ac67 (diff)
chore: move ControlToken enum definition to machine
-rw-r--r--src/machine.rs8
-rw-r--r--src/tokenizer.rs6
-rw-r--r--src/utils.rs5
3 files changed, 8 insertions, 11 deletions
diff --git a/src/machine.rs b/src/machine.rs
index 007f22f..c5bf021 100644
--- a/src/machine.rs
+++ b/src/machine.rs
@@ -2,11 +2,15 @@ use crate::attr::AttrValueSyntax;
use crate::entities::try_read_character_reference;
use crate::offset::{Offset, Position};
use crate::utils::{
- ascii_digit_pat, control_pat, ctostr, noncharacter_pat, surrogate_pat, whitespace_pat,
- ControlToken, State,
+ ascii_digit_pat, control_pat, ctostr, noncharacter_pat, surrogate_pat, whitespace_pat, State,
};
use crate::{reader::Reader, Emitter, Error, Tokenizer};
+pub enum ControlToken {
+ Eof,
+ Continue,
+}
+
// Note: This is not implemented as a method on Tokenizer because there's fields on Tokenizer that
// should not be available in this method, such as Tokenizer.to_reconsume or the Reader instance
#[inline]
diff --git a/src/tokenizer.rs b/src/tokenizer.rs
index 05c1165..6384544 100644
--- a/src/tokenizer.rs
+++ b/src/tokenizer.rs
@@ -1,10 +1,8 @@
-use crate::machine;
+use crate::machine::{self, ControlToken};
use crate::naive_parser::naive_next_state;
use crate::offset::{Offset, Position};
use crate::reader::{IntoReader, Reader};
-use crate::utils::{
- control_pat, noncharacter_pat, surrogate_pat, ControlToken, State as InternalState,
-};
+use crate::utils::{control_pat, noncharacter_pat, surrogate_pat, State as InternalState};
use crate::{Emitter, Error};
// this is a stack that can hold 0 to 2 Ts
diff --git a/src/utils.rs b/src/utils.rs
index c3d2f1a..7d220cf 100644
--- a/src/utils.rs
+++ b/src/utils.rs
@@ -158,11 +158,6 @@ pub enum State {
NumericCharacterReferenceEnd,
}
-pub enum ControlToken {
- Eof,
- Continue,
-}
-
macro_rules! ctostr {
($c:expr) => {
&*$c.encode_utf8(&mut [0; 4])