# They both foward the cursor to the next byte on success, but only `expect`
# functions fire a fatal error on mismatch.
class XophonLexer
+
+ # The model.
var reader_model: XophonReaderModel
- var input: IStream is writable
+
+ # The input to read from.
+ var input: Reader is writable
+
+ # Alias to `reader_model.locator`.
private var locator: SAXLocatorImpl is noinit
init do
# match `expected`.
fun expect_string(expected: String, context: String): Bool do
var chars = expected.chars
- var i: Int = 0
+ var i = 0
while i < chars.length do
if not accept(chars[i]) then