ianprime0509 / zig-xml

XML parser for Zig
http://ianjohnson.dev/zig-xml/
BSD Zero Clause License
14 stars 3 forks source link

Rework scanner reset behavior #25

Closed ianprime0509 closed 1 week ago

ianprime0509 commented 11 months ago

If Scanner returns a token, there is only one state where it cannot simply be reset with no resulting subsequent token after the caller is done with the token: pi_maybe_end. It would be a great simplification opportunity if this could be omitted, and the scanner could just be cleanly reset before starting on the next token in TokenReader.

This is also a reminder to me to double-check on the similar CDATA ending states, which look like they may be handled incorrectly, but I need to confirm (and add a comment explaining why the current behavior is correct if it turns out to be right).

ianprime0509 commented 1 week ago

No longer relevant with #36.