<- Back to shtanton's homepage
aboutsummaryrefslogtreecommitdiff
path: root/subex
diff options
context:
space:
mode:
Diffstat (limited to 'subex')
-rw-r--r--subex/subexast.go6
-rw-r--r--subex/subexstate.go8
2 files changed, 7 insertions, 7 deletions
diff --git a/subex/subexast.go b/subex/subexast.go
index f5b1178..f4088fe 100644
--- a/subex/subexast.go
+++ b/subex/subexast.go
@@ -195,13 +195,13 @@ func (ast SubexASTCopyString) String() string {
return "#"
}
-// Read in a value and copy it out unchanged
-// , is equivalent to `null`|?|%|#|[`{}[]`]
+// Read in a non-terminal value and copy it out unchanged
+// , is equivalent to `null`|?|%|#
type SubexASTCopyValue struct {}
func (ast SubexASTCopyValue) compileWith(next SubexState, slotMap *SlotMap) SubexState {
return &SubexGroupState {
SubexASTCopyString{}.compileWith(next, slotMap),
- &SubexCopyNonStringAtomState {next},
+ &SubexCopyNonStringNonTerminalAtomState {next},
}
}
func (ast SubexASTCopyValue) String() string {
diff --git a/subex/subexstate.go b/subex/subexstate.go
index 4655ef9..7ecff0c 100644
--- a/subex/subexstate.go
+++ b/subex/subexstate.go
@@ -203,11 +203,11 @@ func (state SubexCopyStringAtomState) accepting(store Store, outputStack OutputS
}
// Read in an atom and copy it out as long as it is not part of a string
-type SubexCopyNonStringAtomState struct {
+type SubexCopyNonStringNonTerminalAtomState struct {
next SubexState
}
-func (state SubexCopyNonStringAtomState) eat(store Store, outputStack OutputStack, char walk.Atom) []SubexBranch {
- if char.Typ == walk.AtomStringRune || char.Typ == walk.AtomStringTerminal {
+func (state SubexCopyNonStringNonTerminalAtomState) eat(store Store, outputStack OutputStack, char walk.Atom) []SubexBranch {
+ if char.Typ == walk.AtomStringRune || char.Typ == walk.AtomStringTerminal || char.Typ == walk.AtomTerminal {
return nil
}
return []SubexBranch{{
@@ -216,7 +216,7 @@ func (state SubexCopyNonStringAtomState) eat(store Store, outputStack OutputStac
store: store,
}}
}
-func (state SubexCopyNonStringAtomState) accepting(store Store, outputStack OutputStack) []OutputStack {
+func (state SubexCopyNonStringNonTerminalAtomState) accepting(store Store, outputStack OutputStack) []OutputStack {
return nil
}