aboutsummaryrefslogtreecommitdiff
path: root/src/emitter.rs
diff options
context:
space:
mode:
authorMartin Fischer <martin@push-f.com>2023-09-27 17:19:27 +0200
committerMartin Fischer <martin@push-f.com>2023-09-27 17:19:27 +0200
commit518edf281f93cceb9793224f700a8f3d63d78ea2 (patch)
treec6c0adfe88da9f329ac9c80f8c1e97607c749742 /src/emitter.rs
parent67a812003a18cca016ff8b918610b4b6276ffd86 (diff)
break!: remove Emitter::pop_token, use Iterator instead
Diffstat (limited to 'src/emitter.rs')
-rw-r--r--src/emitter.rs11
1 files changed, 1 insertions, 10 deletions
diff --git a/src/emitter.rs b/src/emitter.rs
index 311c73c..923da1c 100644
--- a/src/emitter.rs
+++ b/src/emitter.rs
@@ -24,21 +24,12 @@ use crate::Error;
#[allow(unused_variables)] // workaround for https://github.com/rust-lang/rust/issues/91074
pub trait Emitter<O> {
- /// The token type emitted by this emitter. This controls what type of values the [`Tokenizer`](crate::Tokenizer)
- /// yields when used as an iterator.
- type Token;
-
- /// The state machine has reached the end of the file. It will soon call `pop_token` for the
- /// last time.
+ /// The state machine has reached the end of the file.
fn emit_eof(&mut self);
/// A (probably recoverable) parsing error has occurred.
fn emit_error(&mut self, error: Error, span: Range<O>);
- /// After every state change, the tokenizer calls this method to retrieve a new token that can
- /// be returned via the tokenizer's iterator interface.
- fn pop_token(&mut self) -> Option<Self::Token>;
-
/// Emit a bunch of plain characters as character tokens.
fn emit_string(&mut self, c: &str);