From 306d481af1daf1becd843fe4fcf0a8a4fb81c89a Mon Sep 17 00:00:00 2001 From: thurston Date: Wed, 26 Mar 2008 22:19:44 +0000 Subject: [PATCH] Need to unset the final state status of the start state in kleene star. Possible to crash ragel by ignoring the warning. git-svn-id: http://svn.complang.org/ragel/trunk@417 052ea7fc-9027-0410-9066-f65837a77df0 --- ragel/fsmgraph.cpp | 2 +- ragel/parsetree.cpp | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/ragel/fsmgraph.cpp b/ragel/fsmgraph.cpp index 1ff0936..b37c4dc 100644 --- a/ragel/fsmgraph.cpp +++ b/ragel/fsmgraph.cpp @@ -1170,7 +1170,7 @@ void FsmAp::mergeStateConds( StateAp *destState, StateAp *srcState ) } /* A state merge which represents the drawing in of leaving transitions. If - * there is any out data then we duplicate the souce state, transfer the out + * there is any out data then we duplicate the source state, transfer the out * data, then merge in the state. The new state will be reaped because it will * not be given any in transitions. */ void FsmAp::mergeStatesLeaving( MergeData &md, StateAp *destState, StateAp *srcState ) diff --git a/ragel/parsetree.cpp b/ragel/parsetree.cpp index 048d171..0230467 100644 --- a/ragel/parsetree.cpp +++ b/ragel/parsetree.cpp @@ -1386,6 +1386,7 @@ FsmAp *FactorWithRep::walk( ParseData *pd ) if ( retFsm->startState->isFinState() ) { warning(loc) << "applying kleene star to a machine that " "accepts zero length word" << endl; + retFsm->unsetFinState( retFsm->startState ); } /* Shift over the start action orders then do the kleene star. */ -- 2.7.4