Using parameters is a helpful suggestion. In my case, it's enough to just
record the error and add a substitution character (explicitly marked as
induced, that is, wasn't actually present in the input) without needing to
rewind or advance the input port. It's sufficient for my purposes to just
I would suggest avoiding exceptions and continuations and have a separate
parameter[*] that holds the current unexpected character handler. You'll
still have to figure out what kind of thing it returns (void, or a
replacement character, or a new input port?), but you have to do that
anyway.
The
I'm working on a tokenizer for that involves some level of "self-healing":
if the input port contains an unexpected character, an error token is to be
emitted, but computation isn't over -- we are to continue by substituting
the bad character with a good one, emitting that, too (thereby
3 matches
Mail list logo