<- Back to shtanton's homepage
aboutsummaryrefslogtreecommitdiff
path: root/subex
diff options
context:
space:
mode:
authorCharlie Stanton <charlie@shtanton.xyz>2023-04-19 15:19:42 +0100
committerCharlie Stanton <charlie@shtanton.xyz>2023-04-19 15:19:42 +0100
commitdae74317d84471f6a859117fcbba1cf546be8ea1 (patch)
treedb8516ba8a5a208d16aaa0e6da439541dd496b94 /subex
parent10f847acc7087317b0fbe20b7cf3307a0fafab8a (diff)
downloadstred-go-dae74317d84471f6a859117fcbba1cf546be8ea1.tar
Adds parsing substitute commands, though executing them currently does nothing
Diffstat (limited to 'subex')
-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,
+ }
+}