<- 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.go8
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,
+ }
+}