summaryrefslogtreecommitdiff
path: root/src/pdarun.c
diff options
context:
space:
mode:
authorAdrian Thurston <thurston@colm.net>2018-07-04 13:31:10 +0700
committerAdrian Thurston <thurston@colm.net>2018-07-04 13:31:10 +0700
commit21c70ccec7283fff33cee96ef5b5fbef9568ed43 (patch)
treee2747ded1e7f2a10d08bd94404845806faf66ddb /src/pdarun.c
parent4f66f3a967c2d7c7f27d95ec52725e8b9d5bf27c (diff)
downloadcolm-21c70ccec7283fff33cee96ef5b5fbef9568ed43.tar.gz
when sending back artificial ignore trees we need to push back to input
Diffstat (limited to 'src/pdarun.c')
-rw-r--r--src/pdarun.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/pdarun.c b/src/pdarun.c
index 6b8057f8..19e7095a 100644
--- a/src/pdarun.c
+++ b/src/pdarun.c
@@ -206,8 +206,12 @@ static void send_back_ignore( program_t *prg, tree_t **sp,
head_t *head = parse_tree->shadow->tree->tokdata;
int artificial = parse_tree->flags & PF_ARTIFICIAL;
- if ( head != 0 && !artificial )
- send_back_text( prg, is, string_data( head ), head->length );
+ if ( head != 0 ) {
+ if ( artificial )
+ send_back_tree( prg, is, parse_tree->shadow->tree );
+ else
+ send_back_text( prg, is, string_data( head ), head->length );
+ }
colm_decrement_steps( pda_run );
@@ -1091,7 +1095,8 @@ static long scan_token( program_t *prg, struct pda_run *pda_run, struct stream_i
while ( true ) {
char *pd = 0;
int len = 0;
- int type = is->funcs->get_parse_block( prg, is, pda_run->toklen, &pd, &len );
+ int toklen = pda_run->toklen;
+ int type = is->funcs->get_parse_block( prg, is, &toklen, &pd, &len );
switch ( type ) {
case INPUT_DATA: