<- Back to shtanton's homepage
aboutsummaryrefslogtreecommitdiff
path: root/subex/lex.go
diff options
context:
space:
mode:
Diffstat (limited to 'subex/lex.go')
-rw-r--r--subex/lex.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/subex/lex.go b/subex/lex.go
index 0f00a99..dfe89b7 100644
--- a/subex/lex.go
+++ b/subex/lex.go
@@ -22,6 +22,9 @@ func (l *StringRuneReader) Next() rune {
func (l *StringRuneReader) Rewind() {
l.pos -= l.width
}
+func (l *StringRuneReader) RewindRune(r rune) {
+ l.pos -= utf8.RuneLen(r)
+}
func NewStringRuneReader(input string) RuneReader {
return &StringRuneReader {