summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAdrian Thurston <thurston@colm.net>2018-05-14 21:01:48 -0400
committerAdrian Thurston <thurston@colm.net>2018-05-14 21:01:48 -0400
commit8b79a2ca4b955742bee4f6f73fff0fad9a30f26a (patch)
treecc0eabeec5c6cad5cc475ab0b6bf691450c6140a /src
parentbd0042d9fa75bd7c2c638a747fc7ab03601e859c (diff)
downloadcolm-8b79a2ca4b955742bee4f6f73fff0fad9a30f26a.tar.gz
don't issue parse finish instructions if parse stop enabled
Diffstat (limited to 'src')
-rw-r--r--src/pdarun.c30
-rw-r--r--src/synthesis.cc6
2 files changed, 18 insertions, 18 deletions
diff --git a/src/pdarun.c b/src/pdarun.c
index c1d45796..2914e562 100644
--- a/src/pdarun.c
+++ b/src/pdarun.c
@@ -2249,26 +2249,24 @@ long colm_parse_finish( program_t *prg, tree_t **sp,
switch ( entry ) {
case PCR_START:
- if ( pda_run->stop_target <= 0 ) {
- si = stream_to_impl( input );
- si->funcs->set_eof( si );
+ si = stream_to_impl( input );
+ si->funcs->set_eof( si );
- if ( ! pda_run->parse_error ) {
- si = stream_to_impl( input );
- long pcr = colm_parse_loop( prg, sp, pda_run, si, entry );
+ if ( ! pda_run->parse_error ) {
+ si = stream_to_impl( input );
+ long pcr = colm_parse_loop( prg, sp, pda_run, si, entry );
- while ( pcr != PCR_DONE ) {
+ while ( pcr != PCR_DONE ) {
- /* COROUTINE */
- return pcr;
- case PCR_REDUCTION:
- case PCR_GENERATION:
- case PCR_PRE_EOF:
- case PCR_REVERSE:
+ /* COROUTINE */
+ return pcr;
+ case PCR_REDUCTION:
+ case PCR_GENERATION:
+ case PCR_PRE_EOF:
+ case PCR_REVERSE:
- si = stream_to_impl( input );
- pcr = colm_parse_loop( prg, sp, pda_run, si, entry );
- }
+ si = stream_to_impl( input );
+ pcr = colm_parse_loop( prg, sp, pda_run, si, entry );
}
}
diff --git a/src/synthesis.cc b/src/synthesis.cc
index f4b02386..96092539 100644
--- a/src/synthesis.cc
+++ b/src/synthesis.cc
@@ -1609,8 +1609,10 @@ UniqueType *LangTerm::evaluateParse( Compiler *pd, CodeVect &code,
* Finish operation
*/
- code.append( IN_SEND_EOF );
- parseFinish( pd, code, stopId );
+ if ( !stop ) {
+ code.append( IN_SEND_EOF );
+ parseFinish( pd, code, stopId );
+ }
/* Pull out the error and save it off. */
code.append( IN_DUP_VAL );