<- Back to shtanton's homepage
aboutsummaryrefslogtreecommitdiff
path: root/main/main.go
diff options
context:
space:
mode:
authorCharlie Stanton <charlie@shtanton.xyz>2023-02-19 08:59:16 +0000
committerCharlie Stanton <charlie@shtanton.xyz>2023-02-19 08:59:16 +0000
commitfba426b3910f16c8abc6f819da3138f03e5f0b1a (patch)
tree9ce7473194a7ac4d97278cff3e95e58fd3277c72 /main/main.go
parent3636825c64bb6c172b0858d7a08c30acfcd68bdd (diff)
downloadstred-go-fba426b3910f16c8abc6f819da3138f03e5f0b1a.tar
Introduces subex processing
Doesn't integrate it at all yet
Diffstat (limited to 'main/main.go')
-rw-r--r--main/main.go9
1 files changed, 5 insertions, 4 deletions
diff --git a/main/main.go b/main/main.go
index 08514ab..3a701ed 100644
--- a/main/main.go
+++ b/main/main.go
@@ -6,6 +6,7 @@ import (
"fmt"
"strings"
"unicode/utf8"
+ "main/subex"
)
type PathSegment interface {}
@@ -619,13 +620,13 @@ func runTransducer(transducer TransducerState, input string) (output string, err
func main() {
if len(os.Args) != 3 {
- panic("Expected: program [input] [subex]")
+ panic("Expected: stred [input] [subex]")
}
input := os.Args[1]
program := os.Args[2]
- ast := parse(program)
- transducer := compileTransducer(ast)
- output, err := runTransducer(transducer, input)
+ ast := subex.Parse(program)
+ transducer := subex.CompileTransducer(ast)
+ output, err := subex.RunTransducer(transducer, input)
if err {
output = input
}