-
Notifications
You must be signed in to change notification settings - Fork 235
Trigger errors without macros, remove unwrap_or_else!
and go_match!
#600
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Signed-off-by: Simon Wülker <[email protected]>
Signed-off-by: Simon Wülker <[email protected]>
Signed-off-by: Simon Wülker <[email protected]>
#[cfg(feature = "trace_tokenizer")] | ||
trace!(" error"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the usefulness of the trace_tokenizer
feature is a bit questionable, but I didn't want to touch it for now. This matches what the sh_trace!
macro would log before.
@@ -1565,7 +1578,10 @@ impl<Sink: TokenSink> Tokenizer<Sink> { | |||
|
|||
states::MarkupDeclarationOpen => go!(self: error; to BogusComment), | |||
|
|||
states::CdataSection => go!(self: emit_temp; error_eof; to Data), | |||
states::CdataSection => { | |||
self.bad_eof_error(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This reorders the eof and emit_tmp. Is that a problem?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any user that relies on this ordering is doing silly things, but it is observable I think. Nice catch!
Signed-off-by: Simon Wülker <[email protected]>
This change is the first step in gradually removing the
go!
macro that is currently used to implement the tokenizer-DSL.When this macro was first introduced it might have made sense to have it - some quality-of-life rust syntax did not exist back then.
But I think it's not necessary anymore and I'm certain that it's possible to remove the DSL without compromising on performance or readability (like this).