diff options
Diffstat (limited to 'subex/subexast.go')
-rw-r--r-- | subex/subexast.go | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/subex/subexast.go b/subex/subexast.go index 9e7067b..cec75f7 100644 --- a/subex/subexast.go +++ b/subex/subexast.go @@ -27,10 +27,11 @@ type SubexASTStore struct { slot rune } func (ast SubexASTStore) compileWith(next SubexState) SubexState { - return &SubexStoreState { - match: ast.match.compileWith(&SubexNoneState{}), - slot: ast.slot, - next: next, + return &SubexStoreBeginState { + next: ast.match.compileWith(&SubexStoreEndState { + slot: ast.slot, + next: next, + }), } } func (ast SubexASTStore) String() string { @@ -188,8 +189,9 @@ type SubexASTSum struct { content SubexAST } func (ast SubexASTSum) compileWith(next SubexState) SubexState { - return &SubexSumState { - inputState: ast.content.compileWith(&SubexNoneState{}), - next: next, + return &SubexSumBeginState { + next: ast.content.compileWith(&SubexSumEndState { + next: next, + }), } } |