diff options
Diffstat (limited to 'subex')
-rw-r--r-- | subex/lex.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/subex/lex.go b/subex/lex.go index 74bf370..0f00a99 100644 --- a/subex/lex.go +++ b/subex/lex.go @@ -22,3 +22,11 @@ func (l *StringRuneReader) Next() rune { func (l *StringRuneReader) Rewind() { l.pos -= l.width } + +func NewStringRuneReader(input string) RuneReader { + return &StringRuneReader { + input: input, + pos: 0, + width: 0, + } +} |