summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian Thurston <thurston@complang.org>2009-03-08 16:08:30 +0000
committerAdrian Thurston <thurston@complang.org>2009-03-08 16:08:30 +0000
commit859c26b3518f113ba21eb065ba54ee4e5f61103d (patch)
treee882c15ebfbb50aadd987e959e0d0bfecbe2a680
parent9104dd570ccd0216b6068f1d19e8b77c49884ba8 (diff)
downloadcolm-859c26b3518f113ba21eb065ba54ee4e5f61103d.tar.gz
Got parse_stop working again. Don't need to set fsmRun->cs to error anymore
because we don't need to break out of the fsmRun loop deeper in the stack.
-rw-r--r--colm/fsmrun.cpp29
1 files changed, 14 insertions, 15 deletions
diff --git a/colm/fsmrun.cpp b/colm/fsmrun.cpp
index 43d63687..133d0048 100644
--- a/colm/fsmrun.cpp
+++ b/colm/fsmrun.cpp
@@ -590,7 +590,6 @@ void send_handle_error( FsmRun *fsmRun, PdaRun *parser, Kid *input )
cerr << "stopping the parse" << endl;
}
#endif
- fsmRun->cs = fsmRun->tables->errorState;
parser->stopParsing = true;
}
}
@@ -907,25 +906,14 @@ void parse( FsmRun *fsmRun, PdaRun *parser )
fsmRun->sendEOF( parser );
if ( fsmRun->eofSent )
break;
+ continue;
}
/* Check for a named language element. */
- if ( tokenId == SCAN_LANG_EL )
+ if ( tokenId == SCAN_LANG_EL ) {
fsmRun->sendNamedLangEl( parser );
-
-/* THIS GOES SOMEWHERE ELSE NOW */
-#if 0
- /* Fall through here either when the input buffer has been exhausted
- * or the scanner is in an error state. Otherwise we must continue. */
- if ( cs == tables->errorState && parser->stopParsing ) {
- #ifdef COLM_LOG_PARSE
- if ( colm_log_parse ) {
- cerr << "scanner has been stopped" << endl;
- }
- #endif
- goto done;
+ continue;
}
-#endif
/* Check for error. */
if ( tokenId == SCAN_ERROR ) {
@@ -941,6 +929,17 @@ void parse( FsmRun *fsmRun, PdaRun *parser )
fsmRun->sendIgnore( parser, tokenId );
else
fsmRun->sendToken( parser, tokenId );
+
+ /* Fall through here either when the input buffer has been exhausted
+ * or the scanner is in an error state. Otherwise we must continue. */
+ if ( parser->stopParsing ) {
+ #ifdef COLM_LOG_PARSE
+ if ( colm_log_parse ) {
+ cerr << "scanner has been stopped" << endl;
+ }
+ #endif
+ break;
+ }
}
}