<- Back to shtanton's homepage
aboutsummaryrefslogtreecommitdiff
path: root/subex/subexast.go
diff options
context:
space:
mode:
authorCharlie Stanton <charlie@shtanton.xyz>2023-02-22 20:52:20 +0000
committerCharlie Stanton <charlie@shtanton.xyz>2023-02-22 20:52:20 +0000
commita2636b27fdadb2b7951fa35fe301e8e6b41fc28a (patch)
tree35561560d067c9987a626c4a77ea3f688547a015 /subex/subexast.go
parent3bd45dc49a35b82dcc4ae93796c3e152d799bc0b (diff)
downloadstred-go-a2636b27fdadb2b7951fa35fe301e8e6b41fc28a.tar
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
Diffstat (limited to 'subex/subexast.go')
-rw-r--r--subex/subexast.go9
1 files changed, 6 insertions, 3 deletions
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 {