This branch refactors rewrite::apply and the Rewrite type's Display impl so that (1) the main "emit Rewrite" function is easier to extend (no more closures) and (2) the Display impl can reuse the rewrite::apply code so we don't have to implement every Rewrite variant twice. The precise design of the new Sink and Emitter types is not very clear, but it achieves the goals above and should work well enough for now.
This branch refactors
rewrite::apply
and theRewrite
type'sDisplay
impl so that (1) the main "emitRewrite
" function is easier to extend (no more closures) and (2) theDisplay
impl can reuse therewrite::apply
code so we don't have to implement everyRewrite
variant twice. The precise design of the newSink
andEmitter
types is not very clear, but it achieves the goals above and should work well enough for now.