summaryrefslogtreecommitdiff
path: root/src/pdarun.c
diff options
context:
space:
mode:
authorAdrian Thurston <thurston@colm.net>2018-05-14 20:45:53 -0400
committerAdrian Thurston <thurston@colm.net>2018-05-14 20:45:53 -0400
commitbd0042d9fa75bd7c2c638a747fc7ab03601e859c (patch)
tree2275f1791ae2a9c86586be7e2266bbd2a8cd85f5 /src/pdarun.c
parentfbc356e504c162663b33162225ebd2fc16b6076b (diff)
downloadcolm-bd0042d9fa75bd7c2c638a747fc7ab03601e859c.tar.gz
don't use parse finish to pull out parse result, use dedeicated instruction
Working towards unifying the parse frag and parse finish instructions.
Diffstat (limited to 'src/pdarun.c')
-rw-r--r--src/pdarun.c15
1 files changed, 2 insertions, 13 deletions
diff --git a/src/pdarun.c b/src/pdarun.c
index 0d4483ab..c1d45796 100644
--- a/src/pdarun.c
+++ b/src/pdarun.c
@@ -1194,7 +1194,7 @@ static long scan_token( program_t *prg, struct pda_run *pda_run, struct stream_i
return SCAN_ERROR;
}
-static tree_t *get_parsed_root( struct pda_run *pda_run, int stop )
+tree_t *get_parsed_root( struct pda_run *pda_run, int stop )
{
if ( pda_run->parse_error )
return 0;
@@ -2240,7 +2240,7 @@ long colm_parse_frag( program_t *prg, tree_t **sp, struct pda_run *pda_run,
return PCR_DONE;
}
-long colm_parse_finish( tree_t **result, program_t *prg, tree_t **sp,
+long colm_parse_finish( program_t *prg, tree_t **sp,
struct pda_run *pda_run, stream_t *input , int revert_on, long entry )
{
struct stream_impl *si;
@@ -2288,17 +2288,6 @@ long colm_parse_finish( tree_t **result, program_t *prg, tree_t **sp,
if ( !revert_on )
colm_rcode_downref_all( prg, sp, &pda_run->reverse_code );
-
- tree_t *tree = get_parsed_root( pda_run, pda_run->stop_target > 0 );
-
- if ( pda_run->reducer ) {
- *result = 0;
- }
- else {
- colm_tree_upref( tree );
- *result = tree;
- }
-
/* COROUTINE */
case PCR_DONE: