<- Back to shtanton's homepage
summaryrefslogtreecommitdiff
path: root/main/subexstate.go
diff options
context:
space:
mode:
Diffstat (limited to 'main/subexstate.go')
-rw-r--r--main/subexstate.go20
1 files changed, 20 insertions, 0 deletions
diff --git a/main/subexstate.go b/main/subexstate.go
index 00b9e75..880be38 100644
--- a/main/subexstate.go
+++ b/main/subexstate.go
@@ -123,3 +123,23 @@ func (state SubexCopyAnyState) eat(store Store, char rune) []SubexBranch {
func (state SubexCopyAnyState) accepting(store Store) []string {
return nil
}
+
+type SubexRangeState struct {
+ parts map[rune]rune
+ next SubexState
+}
+func (state SubexRangeState) eat(store Store, char rune) []SubexBranch {
+ out, exists := state.parts[char]
+ if !exists {
+ return nil
+ } else {
+ return []SubexBranch{{
+ state: state.next,
+ output: string(out),
+ store: store,
+ }}
+ }
+}
+func (state SubexRangeState) accepting(store Store) []string {
+ return nil
+}