<- Back to shtanton's homepage
aboutsummaryrefslogtreecommitdiff
path: root/subex/lex.go
diff options
context:
space:
mode:
authorCharlie Stanton <charlie@shtanton.xyz>2024-12-15 17:54:45 +0000
committerCharlie Stanton <charlie@shtanton.xyz>2024-12-15 17:54:45 +0000
commit62aa738be03845f96c40edde087ea39693b27e4e (patch)
tree81a86faa96db42d9da5e7014f53974468229d3e6 /subex/lex.go
parentb434fe4e14f6dcc8d1d7433a29351b8e8ea77d37 (diff)
downloadstred-go-62aa738be03845f96c40edde087ea39693b27e4e.tar
Implement new number systemnumbers
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 {