From 62aa738be03845f96c40edde087ea39693b27e4e Mon Sep 17 00:00:00 2001 From: Charlie Stanton Date: Sun, 15 Dec 2024 17:54:45 +0000 Subject: Implement new number system --- subex/lex.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'subex/lex.go') 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 { -- cgit v1.2.3