aboutsummaryrefslogtreecommitdiff
path: root/src/tokenizer
diff options
context:
space:
mode:
authorMartin Fischer <martin@push-f.com>2021-11-28 09:31:09 +0100
committerMartin Fischer <martin@push-f.com>2021-11-29 15:11:01 +0100
commit7c1d81e134dcc33ae78d992ab3db30decadec6d9 (patch)
tree18fe98d3521430e57ef219a41df740433a71ccdd /src/tokenizer
parentd5ef05694f5ed4bbba164d0c9ee15106b134a358 (diff)
refactor: slightly simplify go! DSL
Diffstat (limited to 'src/tokenizer')
-rw-r--r--src/tokenizer/mod.rs10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/tokenizer/mod.rs b/src/tokenizer/mod.rs
index 23385d7..274bf44 100644
--- a/src/tokenizer/mod.rs
+++ b/src/tokenizer/mod.rs
@@ -629,13 +629,8 @@ macro_rules! go (
return $me.emit_current_tag();
});
- ( $me:ident : eof ) => ({ $me.emit_eof(); return ProcessResult::Suspend; });
-
// If nothing else matched, it's a single command
( $me:ident : $($cmd:tt)+ ) => ( sh_trace!($me: $($cmd)+) );
-
- // or nothing.
- ( $me:ident : ) => (());
);
macro_rules! go_match ( ( $me:ident : $x:expr, $($pats:pat),+ => $($cmds:tt)* ) => (
@@ -1434,7 +1429,10 @@ impl<Sink: TokenSink> Tokenizer<Sink> {
| states::RawData(Rcdata)
| states::RawData(Rawtext)
| states::RawData(ScriptData)
- | states::Plaintext => go!(self: eof),
+ | states::Plaintext => {
+ self.emit_eof();
+ ProcessResult::Suspend
+ }
states::TagName
| states::RawData(ScriptDataEscaped(_))