<- Back to shtanton's homepage
aboutsummaryrefslogtreecommitdiff
path: root/subex/main.go
diff options
context:
space:
mode:
authorCharlie Stanton <charlie@shtanton.xyz>2023-04-19 14:34:22 +0100
committerCharlie Stanton <charlie@shtanton.xyz>2023-04-19 14:34:22 +0100
commit10f847acc7087317b0fbe20b7cf3307a0fafab8a (patch)
tree4abf2f4009fcac55013672e841b2f9d3a2b2fb52 /subex/main.go
parent5089fe689f17a3489b6be76588b8fc7f93d70e55 (diff)
downloadstred-go-10f847acc7087317b0fbe20b7cf3307a0fafab8a.tar
Changes the parsing API for subex to be more suitable to being part of a larger program
Diffstat (limited to 'subex/main.go')
-rw-r--r--subex/main.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/subex/main.go b/subex/main.go
index 091625b..9824f10 100644
--- a/subex/main.go
+++ b/subex/main.go
@@ -131,7 +131,12 @@ func Main() {
panic("Expected: program [subex]")
}
program := os.Args[1]
- ast := Parse(program)
+ reader := &StringRuneReader {
+ input: program,
+ pos: 0,
+ width: 0,
+ }
+ ast := Parse(reader)
transducer := CompileTransducer(ast)
stdin := bufio.NewReader(os.Stdin);