summaryrefslogtreecommitdiff
path: root/ragel/goipgoto.cpp
diff options
context:
space:
mode:
authorAnton Ageev <antage@gmail.com>2013-02-02 10:02:55 +0400
committerAnton Ageev <antage@gmail.com>2013-02-02 10:39:18 +0400
commite87bd8a9ffbab6e725b70a3143c275bb6c45fdeb (patch)
tree624e5fdb76fb84bffc64b17355a04bdf7ee58477 /ragel/goipgoto.cpp
parentce87ce94a5b49500f446e4eaab1a829ce8048386 (diff)
downloadragel-e87bd8a9ffbab6e725b70a3143c275bb6c45fdeb.tar.gz
Fixed bug in Go code generator: missing label in goto
Diffstat (limited to 'ragel/goipgoto.cpp')
-rw-r--r--ragel/goipgoto.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/ragel/goipgoto.cpp b/ragel/goipgoto.cpp
index c72f0004..a6dbd9cf 100644
--- a/ragel/goipgoto.cpp
+++ b/ragel/goipgoto.cpp
@@ -163,10 +163,7 @@ std::ostream &GoIpGotoCodeGen::STATE_GOTOS_SWITCH( int level )
{
for ( RedStateList::Iter st = redFsm->stateList; st.lte(); st++ ) {
out << TABS(level) << "case " << st->id << ":" << endl;
- if ( redFsm->errState == st )
- out << TABS(level + 1) << "goto st" << st->id << endl;
- else
- out << TABS(level + 1) << "goto st" << st->id << "_body" << endl;
+ out << TABS(level + 1) << "goto st_case_" << st->id << endl;
}
return out;
}
@@ -204,7 +201,7 @@ void GoIpGotoCodeGen::GOTO_HEADER( RedStateAp *state, int level )
}
/* Give the state a label. */
- out << TABS(level) << "st" << state->id << "_body:" << endl;
+ out << TABS(level) << "st_case_" << state->id << ":" << endl;
if ( state->fromStateAction != 0 ) {
/* Remember that we wrote an action. Write every action in the list. */
@@ -234,6 +231,7 @@ void GoIpGotoCodeGen::STATE_GOTO_ERROR( int level )
if ( anyWritten )
genLineDirective( out );
+ out << "st_case_" << state->id << ":" << endl;
if ( state->labelNeeded )
out << TABS(level) << "st" << state->id << ":" << endl;