diff options
author | Charlie Stanton <charlie@shtanton.xyz> | 2023-04-19 14:34:22 +0100 |
---|---|---|
committer | Charlie Stanton <charlie@shtanton.xyz> | 2023-04-19 14:34:22 +0100 |
commit | 10f847acc7087317b0fbe20b7cf3307a0fafab8a (patch) | |
tree | 4abf2f4009fcac55013672e841b2f9d3a2b2fb52 /subex/main.go | |
parent | 5089fe689f17a3489b6be76588b8fc7f93d70e55 (diff) | |
download | stred-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.go | 7 |
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); |