Age | Commit message (Collapse) | Author |
|
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.
|
|
Previously the PosTrackingReader always mysteriously subtracted 1
from the current position ... this wasn't sound at all ... the machine
just happens to often call `Tokenizer::unread_char` ... but not always.
E.g. for proper comments it didn't which resulted in their offset and
spans being off-by-one, which is fixed by this commit (see test_spans.rs).
|
|
Emitters should not have access to the reader at all. Also the
current position of the reader, at the time an Emitted method is
called, very much depends on machine implementation details such
as if `Tokenizer::unread_char` is used. Having the Emitter
methods take offsets lets the machine take care of providing
the right offsets, as evidenced by the next commit.
|
|
|
|
|
|
This is primarily done to make the rustdoc more readable
(by grouping Reader, IntoReader, StringReader and BufReadReader
in the reader module). Ideally IntoReader is already implemented
for your input type and you don't have to concern yourself
with these traits / types at all.
|
|
|
|
|
|
|
|
|
|
Before the following happened:
% printf '<script><b>test</b></script>' | cargo run --example=switch-state
StartTag(StartTag { self_closing: false, name: "script", attributes: {} })
String("<b>test")
EndTag(EndTag { name: "b" })
EndTag(EndTag { name: "script" })
Which is obviously wrong. After a <script> tag we want to switch to the
ScriptData state (instead of the Data state).
This commit fixes this implementation error, making the above command
produce the expected output of:
StartTag(StartTag { self_closing: false, name: "script", attributes: {} })
String("<b>test</b>")
EndTag(EndTag { name: "script" })
|
|
|
|
purpose: don't want to expose self.to_reconsume to the consume() method
|
|
|