summaryrefslogtreecommitdiff
path: root/src/pdarun.c
diff options
context:
space:
mode:
authorAdrian Thurston <thurston@colm.net>2018-05-15 00:24:57 -0400
committerAdrian Thurston <thurston@colm.net>2018-05-15 00:24:57 -0400
commit63db79925f869f0fa5336764325d80e80668af76 (patch)
tree21ef32b930eb6efce6ac127b7ccdd1dc5154eda8 /src/pdarun.c
parentc923930f14224b5b46ddc7e95352247e698bcfe8 (diff)
downloadcolm-63db79925f869f0fa5336764325d80e80668af76.tar.gz
added an instruction for the final reduce commit
Was doing this in the parse finish instruction. Moving this out is the last change to make the frag and finish parses identical.
Diffstat (limited to 'src/pdarun.c')
-rw-r--r--src/pdarun.c21
1 files changed, 8 insertions, 13 deletions
diff --git a/src/pdarun.c b/src/pdarun.c
index 79b40528..227dd3bd 100644
--- a/src/pdarun.c
+++ b/src/pdarun.c
@@ -2214,8 +2214,6 @@ long colm_parse_frag( program_t *prg, tree_t **sp, struct pda_run *pda_run,
case PCR_START:
if ( ! pda_run->parse_error ) {
- //pda_run->stop_target = stop_id;
-
long pcr = colm_parse_loop( prg, sp, pda_run,
stream_to_impl( input ), entry );
@@ -2270,17 +2268,6 @@ long colm_parse_finish( program_t *prg, tree_t **sp,
}
}
- /* Flush out anything not committed. */
- if ( pda_run->reducer )
- commit_reduce( prg, sp, pda_run );
-
- /* What to do here.
- * if ( pda_run->fail_parsing )
- * goto fail; */
-
- //if ( !revert_on )
- // colm_rcode_downref_all( prg, sp, &pda_run->reverse_code );
-
/* COROUTINE */
case PCR_DONE:
break; }
@@ -2288,6 +2275,14 @@ long colm_parse_finish( program_t *prg, tree_t **sp,
return PCR_DONE;
}
+void colm_parse_reduce_commit( program_t *prg, tree_t **sp,
+ struct pda_run *pda_run )
+{
+ /* Flush out anything not committed. */
+ if ( pda_run->reducer )
+ commit_reduce( prg, sp, pda_run );
+}
+
long colm_parse_undo_frag( program_t *prg, tree_t **sp, struct pda_run *pda_run,
stream_t *input, long steps, long entry )
{