aboutsummaryrefslogtreecommitdiff
path: root/src/machine.rs
diff options
context:
space:
mode:
authorMartin Fischer <martin@push-f.com>2023-08-12 08:15:45 +0200
committerMartin Fischer <martin@push-f.com>2023-08-19 13:41:55 +0200
commitae5d8185a5b419f89d520504c1cb4c59c26879bf (patch)
tree0198c59440111154e2aaca1e8d4e8fb0809699c4 /src/machine.rs
parent180f6d6111b966627aa00a4017b6fb9751f7386c (diff)
feat: make attribute value syntax recognizable
Note that while making this breaking change, we're also swapping the parameter order for more consistency so that the reader parameter always comes last in Emitter methods.
Diffstat (limited to 'src/machine.rs')
-rw-r--r--src/machine.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/machine.rs b/src/machine.rs
index a58a754..ccd3052 100644
--- a/src/machine.rs
+++ b/src/machine.rs
@@ -1,3 +1,4 @@
+use crate::attr::AttrValueSyntax;
use crate::entities::try_read_character_reference;
use crate::offset::{Offset, Position};
use crate::utils::{
@@ -757,13 +758,13 @@ where
Some(whitespace_pat!()) => Ok(ControlToken::Continue),
Some('"') => {
slf.emitter
- .init_attribute_value(slf.reader.position(), true);
+ .init_attribute_value(AttrValueSyntax::DoubleQuoted, slf.reader.position());
slf.state = State::AttributeValueDoubleQuoted;
Ok(ControlToken::Continue)
}
Some('\'') => {
slf.emitter
- .init_attribute_value(slf.reader.position(), true);
+ .init_attribute_value(AttrValueSyntax::SingleQuoted, slf.reader.position());
slf.state = State::AttributeValueSingleQuoted;
Ok(ControlToken::Continue)
}
@@ -775,7 +776,7 @@ where
}
c => {
slf.emitter
- .init_attribute_value(slf.reader.position() - 1, false);
+ .init_attribute_value(AttrValueSyntax::Unquoted, slf.reader.position() - 1);
slf.state = State::AttributeValueUnquoted;
slf.unread_char(c);
Ok(ControlToken::Continue)