<- Back to shtanton's homepage
aboutsummaryrefslogtreecommitdiff
path: root/subex/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'subex/main.go')
-rw-r--r--subex/main.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/subex/main.go b/subex/main.go
index ae829d9..c1718a4 100644
--- a/subex/main.go
+++ b/subex/main.go
@@ -112,6 +112,9 @@ func RunTransducer(transducer SubexState, input []walk.Atom) (output []walk.Atom
newStates = append(newStates, state.eat(piece)...)
}
states = pruneStates(newStates)
+ if len(states) == 0 {
+ return nil, true
+ }
}
for _, state := range states {
acceptingStacks := state.accepting()