Need to unset the final state status of the start state in kleene star.
authorthurston <thurston@052ea7fc-9027-0410-9066-f65837a77df0>
Wed, 26 Mar 2008 22:19:44 +0000 (22:19 +0000)
committerthurston <thurston@052ea7fc-9027-0410-9066-f65837a77df0>
Wed, 26 Mar 2008 22:19:44 +0000 (22:19 +0000)
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
ragel/parsetree.cpp

index 1ff0936..b37c4dc 100644 (file)
@@ -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 )
index 048d171..0230467 100644 (file)
@@ -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. */