From a2636b27fdadb2b7951fa35fe301e8e6b41fc28a Mon Sep 17 00:00:00 2001 From: Charlie Stanton Date: Wed, 22 Feb 2023 20:52:20 +0000 Subject: Modify subex to take JSON split into "data" Currently no way to reassemble the data on the other side Much of the potential data cannot be interacted with meaningfully, only the string functionality is implemented Should rename data to something else --- subex/subexast.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'subex/subexast.go') diff --git a/subex/subexast.go b/subex/subexast.go index c583245..0afd3e3 100644 --- a/subex/subexast.go +++ b/subex/subexast.go @@ -2,6 +2,7 @@ package subex import ( "fmt" + "main/walk" ) type SubexAST interface { @@ -90,10 +91,12 @@ func (ast SubexASTRepeat) compileWith(next SubexState) SubexState { return next } -type SubexASTCopyRune rune +type SubexASTCopyRune struct { + datum walk.Datum +} func (ast SubexASTCopyRune) compileWith(next SubexState) SubexState { return &SubexCopyRuneState{ - rune: rune(ast), + rune: ast.datum, next: next, } } @@ -153,7 +156,7 @@ func (ast SubexASTJoin) compileWith(next SubexState) SubexState { } type SubexASTRange struct { - parts map[rune]rune + parts map[walk.Datum]walk.Datum } func (ast SubexASTRange) compileWith(next SubexState) SubexState { return &SubexRangeState { -- cgit v1.2.3