diff options
author | Charlie Stanton <charlie@shtanton.xyz> | 2022-12-22 15:23:28 +0000 |
---|---|---|
committer | Charlie Stanton <charlie@shtanton.xyz> | 2022-12-22 15:23:28 +0000 |
commit | fb1f51d1da22f34509cf3fe1d174296d36a0f0ad (patch) | |
tree | f07260b169af51288e76ae095b3dce3a21f01148 /main/main.go | |
parent | f3911888915f6aa96e6b28bd2a98a662faf20f47 (diff) | |
download | subex-fb1f51d1da22f34509cf3fe1d174296d36a0f0ad.tar |
Expressions inside stores are now subexes instead of regexes
This simplifies things by no longer needing a regex implementation
It also enables transforming text as it is being read into a slot
Diffstat (limited to 'main/main.go')
-rw-r--r-- | main/main.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/main/main.go b/main/main.go index be43d90..0466371 100644 --- a/main/main.go +++ b/main/main.go @@ -27,6 +27,11 @@ func (store Store) clone() Store { } return newStore } +func (store Store) withValue(key rune, value string) Store { + newStore := store.clone() + newStore[key] = value + return newStore +} func compileTransducer(transducerAst SubexAST) SubexState { return transducerAst.compileWith(SubexNoneState{}) |