From fb1f51d1da22f34509cf3fe1d174296d36a0f0ad Mon Sep 17 00:00:00 2001 From: Charlie Stanton Date: Thu, 22 Dec 2022 15:23:28 +0000 Subject: 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 --- main/main.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'main/main.go') 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{}) -- cgit v1.2.3