Thinking more about this, I wonder if it would make sense to have these functions be more like a straight filter, where it takes in an input stream and output stream. Perhaps even separating it further into the functions that do a single iteration, and the different types of loops that might wrap those iterators. So we could have a filter function that takes a stream input, then grabs the next slice, filters it for “macro definition”, and returns an instruction. The “macro parser” would just iterate this in a loop until the definition is closed. Then we could have a small library of filter functions, and a set of processing loops that use them to transform byteco.
---
This kind of went well, and surprisingly some test symbols are exporting now. The next step is to get these writing out through the library.