diff options
author | Charlie Stanton <charlie@shtanton.xyz> | 2023-02-19 08:59:16 +0000 |
---|---|---|
committer | Charlie Stanton <charlie@shtanton.xyz> | 2023-02-19 08:59:16 +0000 |
commit | fba426b3910f16c8abc6f819da3138f03e5f0b1a (patch) | |
tree | 9ce7473194a7ac4d97278cff3e95e58fd3277c72 /main | |
parent | 3636825c64bb6c172b0858d7a08c30acfcd68bdd (diff) | |
download | stred-go-fba426b3910f16c8abc6f819da3138f03e5f0b1a.tar |
Introduces subex processing
Doesn't integrate it at all yet
Diffstat (limited to 'main')
-rw-r--r-- | main/main.go | 9 |
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 } |