summaryrefslogtreecommitdiff
path: root/src/libfsm/goto.cc
diff options
context:
space:
mode:
authorAdrian Thurston <thurston@colm.net>2021-12-28 18:23:45 +0000
committerAdrian Thurston <thurston@colm.net>2021-12-28 18:26:40 +0000
commit2d8ba76ddaf6634f285d0a81ee42d5ee77d084cf (patch)
tree1633004184b2281a14ab876df19437ab44f185df /src/libfsm/goto.cc
parentbe2c9cf238ec1d048e3b2d05f1b56a9f2a267668 (diff)
downloadcolm-2d8ba76ddaf6634f285d0a81ee42d5ee77d084cf.tar.gz
generate a check for EOF if there are from-state actions
From-state actions now execute on EOF, but we don't check for their presence when deciding if we should test against EOF. This led to from-state actions executing only if other conditions necessitating EOF-testing are present. Added the check. refs adrian-thurston/ragel#80
Diffstat (limited to 'src/libfsm/goto.cc')
-rw-r--r--src/libfsm/goto.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libfsm/goto.cc b/src/libfsm/goto.cc
index 610f44d1..04d381d9 100644
--- a/src/libfsm/goto.cc
+++ b/src/libfsm/goto.cc
@@ -368,7 +368,7 @@ void Goto::FROM_STATE_ACTION_EMIT( RedStateAp *state )
std::ostream &Goto::STATE_CASES()
{
- bool eof = redFsm->anyEofActivity() || redFsm->anyNfaStates();
+ bool eof = redFsm->anyEofActivity() || redFsm->anyNfaStates() || redFsm->anyFromStateActions();
for ( RedStateList::Iter st = redFsm->stateList; st.lte(); st++ ) {
/* Writing code above state gotos. */
@@ -881,7 +881,7 @@ void Goto::writeExec()
out << EMIT_LABEL( _resume );
/* Do we break out on no more input. */
- bool eof = redFsm->anyEofActivity() || redFsm->anyNfaStates();
+ bool eof = redFsm->anyEofActivity() || redFsm->anyNfaStates() || redFsm->anyFromStateActions();
if ( !noEnd ) {
if ( eof ) {
out <<