More fixes for ruby 1.9.
authorthurston <thurston@052ea7fc-9027-0410-9066-f65837a77df0>
Sat, 5 Jan 2008 21:10:11 +0000 (21:10 +0000)
committerthurston <thurston@052ea7fc-9027-0410-9066-f65837a77df0>
Sat, 5 Jan 2008 21:10:11 +0000 (21:10 +0000)
git-svn-id: http://svn.complang.org/ragel/trunk@380 052ea7fc-9027-0410-9066-f65837a77df0

rlgen-ruby/rbx-gotocodegen.cpp
rlgen-ruby/ruby-codegen.cpp
rlgen-ruby/ruby-fflatcodegen.cpp
rlgen-ruby/ruby-flatcodegen.cpp
rlgen-ruby/ruby-ftabcodegen.cpp

index d6ba375..ecb965a 100644 (file)
@@ -58,7 +58,7 @@ std::ostream &RbxGotoCodeGen::TO_STATE_ACTION_SWITCH()
                /* Write out referenced actions. */
                if ( act->numToStateRefs > 0 ) {
                        /* Write the case label, the action and the case break. */
-                       out << "\twhen " << act->actionId << "\n";
+                       out << "\twhen " << act->actionId << " then\n";
                        ACTION( out, act, 0, false );
                }
        }
@@ -74,7 +74,7 @@ std::ostream &RbxGotoCodeGen::FROM_STATE_ACTION_SWITCH()
                /* Write out referenced actions. */
                if ( act->numFromStateRefs > 0 ) {
                        /* Write the case label, the action and the case break. */
-                       out << "\twhen " << act->actionId << "\n";
+                       out << "\twhen " << act->actionId << " then\n";
                        ACTION( out, act, 0, false );
                }
        }
@@ -90,7 +90,7 @@ std::ostream &RbxGotoCodeGen::EOF_ACTION_SWITCH()
                /* Write out referenced actions. */
                if ( act->numEofRefs > 0 ) {
                        /* Write the case label, the action and the case break. */
-                       out << "\twhen " << act->actionId << "\n";
+                       out << "\twhen " << act->actionId << " then\n";
                        ACTION( out, act, 0, true );
                }
        }
@@ -106,7 +106,7 @@ std::ostream &RbxGotoCodeGen::ACTION_SWITCH()
                /* Write out referenced actions. */
                if ( act->numTransRefs > 0 ) {
                        /* Write the case label, the action and the case break. */
-                       out << "\twhen " << act->actionId << "\n";
+                       out << "\twhen " << act->actionId << " then\n";
                        ACTION( out, act, 0, false );
                }
        }
@@ -118,7 +118,7 @@ std::ostream &RbxGotoCodeGen::ACTION_SWITCH()
 void RbxGotoCodeGen::GOTO_HEADER( RedStateAp *state )
 {
        /* Label the state. */
-       out << "when " << state->id << "\n";
+       out << "when " << state->id << " then\n";
 }
 
 
@@ -144,7 +144,7 @@ void RbxGotoCodeGen::emitSingleSwitch( RedStateAp *state )
 
                /* Write out the single indicies. */
                for ( int j = 0; j < numSingles; j++ ) {
-                       out << "\t\twhen " << KEY(data[j].lowKey) << "\n";
+                       out << "\t\twhen " << KEY(data[j].lowKey) << " then\n";
                        TRANS_GOTO(data[j].value, 0) << "\n";
                }
                
@@ -251,7 +251,7 @@ void RbxGotoCodeGen::STATE_GOTO_ERROR()
        /* Label the state and bail immediately. */
        outLabelUsed = true;
        RedStateAp *state = redFsm->errState;
-       out << "when " << state->id << "\n";
+       out << "when " << state->id << " then\n";
        rbxGoto(out << "        ", "_out") << "\n";
 }
 
@@ -550,7 +550,7 @@ std::ostream &RbxGotoCodeGen::FINISH_CASES()
                /* States that are final and have an out action need a case. */
                if ( st->eofAction != 0 ) {
                        /* Write the case label. */
-                       out << "\t\twhen " << st->id << "\n";
+                       out << "\t\twhen " << st->id << " then\n";
 
                        /* Write the goto func. */
                        rbxGoto(out, label("f", st->eofAction->actListId)) << "\n";
index bccee3d..29146cb 100644 (file)
@@ -570,7 +570,7 @@ void RubyCodeGen::LM_SWITCH( ostream &ret, InlineItem *item,
 
        for ( InlineList::Iter lma = *item->children; lma.lte(); lma++ ) {
                /* Write the case label, the action and the case break. */
-               ret << "        when " << lma->lmId << ":\n";
+               ret << "        when " << lma->lmId << " then\n";
 
                /* Write the block and close it off. */
                ret << "        begin";
index 007c7e1..0f0df54 100644 (file)
@@ -160,7 +160,7 @@ std::ostream &RubyFFlatCodeGen::TO_STATE_ACTION_SWITCH()
        for ( ActionTableMap::Iter redAct = redFsm->actionMap; redAct.lte(); redAct++ ) {
                if ( redAct->numToStateRefs > 0 ) {
                        /* Write the entry label. */
-                       out << "\twhen " << redAct->actListId+1 << "\n";
+                       out << "\twhen " << redAct->actListId+1 << " then\n";
 
                        /* Write each action in the list of action items. */
                        for ( ActionTable::Iter item = redAct->key; item.lte(); item++ )
@@ -180,7 +180,7 @@ std::ostream &RubyFFlatCodeGen::FROM_STATE_ACTION_SWITCH()
        for ( ActionTableMap::Iter redAct = redFsm->actionMap; redAct.lte(); redAct++ ) {
                if ( redAct->numFromStateRefs > 0 ) {
                        /* Write the entry label. */
-                       out << "\twhen " << redAct->actListId+1 << "\n";
+                       out << "\twhen " << redAct->actListId+1 << " then\n";
 
                        /* Write each action in the list of action items. */
                        for ( ActionTable::Iter item = redAct->key; item.lte(); item++ )
@@ -198,7 +198,7 @@ std::ostream &RubyFFlatCodeGen::EOF_ACTION_SWITCH()
        for ( ActionTableMap::Iter redAct = redFsm->actionMap; redAct.lte(); redAct++ ) {
                if ( redAct->numEofRefs > 0 ) {
                        /* Write the entry label. */
-                       out << "\twhen " << redAct->actListId+1 << "\n";
+                       out << "\twhen " << redAct->actListId+1 << " then\n";
 
                        /* Write each action in the list of action items. */
                        for ( ActionTable::Iter item = redAct->key; item.lte(); item++ )
@@ -218,7 +218,7 @@ std::ostream &RubyFFlatCodeGen::ACTION_SWITCH()
        for ( ActionTableMap::Iter redAct = redFsm->actionMap; redAct.lte(); redAct++ ) {
                if ( redAct->numTransRefs > 0 ) {
                        /* Write the entry label. */
-                       out << "\twhen " << redAct->actListId+1 << "\n";
+                       out << "\twhen " << redAct->actListId+1 << " then\n";
 
                        /* Write each action in the list of action items. */
                        for ( ActionTable::Iter item = redAct->key; item.lte(); item++ )
index 0d4196b..ea20b55 100644 (file)
@@ -35,7 +35,7 @@ std::ostream &RubyFlatCodeGen::TO_STATE_ACTION_SWITCH()
                /* Write out referenced actions. */
                if ( act->numToStateRefs > 0 ) {
                        /* Write the case label, the action and the case break */
-                       out << "\twhen " << act->actionId << "\n";
+                       out << "\twhen " << act->actionId << " then\n";
                        ACTION( out, act, 0, false );
                }
        }
@@ -51,7 +51,7 @@ std::ostream &RubyFlatCodeGen::FROM_STATE_ACTION_SWITCH()
                /* Write out referenced actions. */
                if ( act->numFromStateRefs > 0 ) {
                        /* Write the case label, the action and the case break */
-                       out << "\twhen " << act->actionId << "\n";
+                       out << "\twhen " << act->actionId << " then\n";
                        ACTION( out, act, 0, false );
                }
        }
@@ -67,7 +67,7 @@ std::ostream &RubyFlatCodeGen::EOF_ACTION_SWITCH()
                /* Write out referenced actions. */
                if ( act->numEofRefs > 0 ) {
                        /* Write the case label, the action and the case break */
-                       out << "\twhen " << act->actionId << "\n";
+                       out << "\twhen " << act->actionId << " then\n";
                        ACTION( out, act, 0, true );
                }
        }
@@ -83,7 +83,7 @@ std::ostream &RubyFlatCodeGen::ACTION_SWITCH()
                /* Write out referenced actions. */
                if ( act->numTransRefs > 0 ) {
                        /* Write the case label, the action and the case break */
-                       out << "\twhen " << act->actionId << "\n";
+                       out << "\twhen " << act->actionId << " then\n";
                        ACTION( out, act, 0, false );
                }
        }
@@ -320,7 +320,7 @@ void RubyFlatCodeGen::COND_TRANSLATE()
                "       case _cond \n";
        for ( CondSpaceList::Iter csi = condSpaceList; csi.lte(); csi++ ) {
                CondSpace *condSpace = csi;
-               out << "        when " << condSpace->condSpaceId + 1 << "\n";
+               out << "        when " << condSpace->condSpaceId + 1 << " then\n";
                out << TABS(2) << "_widec = " << "(" <<
                                KEY(condSpace->baseKey) << " + (" << GET_KEY() << 
                                " - " << KEY(keyOps->minKey) << "))\n";
index 930c2af..f841e49 100644 (file)
@@ -136,7 +136,7 @@ std::ostream &RubyFTabCodeGen::TO_STATE_ACTION_SWITCH()
        for ( ActionTableMap::Iter redAct = redFsm->actionMap; redAct.lte(); redAct++ ) {
                if ( redAct->numToStateRefs > 0 ) {
                        /* Write the entry label. */
-                       out << "\twhen " << redAct->actListId+1 << "\n";
+                       out << "\twhen " << redAct->actListId+1 << " then\n";
 
                        /* Write each action in the list of action items. */
                        for ( ActionTable::Iter item = redAct->key; item.lte(); item++ )
@@ -157,7 +157,7 @@ std::ostream &RubyFTabCodeGen::FROM_STATE_ACTION_SWITCH()
        for ( ActionTableMap::Iter redAct = redFsm->actionMap; redAct.lte(); redAct++ ) {
                if ( redAct->numFromStateRefs > 0 ) {
                        /* Write the entry label. */
-                       out << "\twhen " << redAct->actListId+1 << ":\n";
+                       out << "\twhen " << redAct->actListId+1 << " then\n";
 
                        /* Write each action in the list of action items. */
                        for ( ActionTable::Iter item = redAct->key; item.lte(); item++ )
@@ -176,7 +176,7 @@ std::ostream &RubyFTabCodeGen::EOF_ACTION_SWITCH()
        for ( ActionTableMap::Iter redAct = redFsm->actionMap; redAct.lte(); redAct++ ) {
                if ( redAct->numEofRefs > 0 ) {
                        /* Write the entry label. */
-                       out << "\twhen " << redAct->actListId+1 << ":\n";
+                       out << "\twhen " << redAct->actListId+1 << " then\n";
 
                        /* Write each action in the list of action items. */
                        for ( ActionTable::Iter item = redAct->key; item.lte(); item++ )
@@ -197,7 +197,7 @@ std::ostream &RubyFTabCodeGen::ACTION_SWITCH()
        for ( ActionTableMap::Iter redAct = redFsm->actionMap; redAct.lte(); redAct++ ) {
                if ( redAct->numTransRefs > 0 ) {
                        /* Write the entry label. */
-                       out << "\twhen " << redAct->actListId+1 << ":\n";
+                       out << "\twhen " << redAct->actListId+1 << " then\n";
 
                        /* Write each action in the list of action items. */
                        for ( ActionTable::Iter item = redAct->key; item.lte(); item++ )