-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Closed
Description
The functions taking a RuneReader will read 2 runes past the end of the match. This means that unless your RuneReader supports seeking, you will lose some of your input. bufio is the most common RuneReader and it does not support seeking. We can defer reading the lookahead rune until after we've checked for a match. That gets gives us one of the Runes. However, we must read one past the final match because that rune might also match. We could consider using RuneScanner and putting the rune back after the final match. Not sure if it's possible to have the property of just reading the match in all cases. I think it might break when the last op is an alternation or a conditional. Still, I think it's worth doing.