summaryrefslogtreecommitdiff
path: root/src/bytecode.c
diff options
context:
space:
mode:
authorAdrian Thurston <thurston@colm.net>2019-05-23 09:30:12 -0400
committerAdrian Thurston <thurston@colm.net>2019-05-23 09:30:12 -0400
commit984e6fb6cf25eee7dafe59db2be6b31b3c7c4b26 (patch)
treed89e8f6a4b61395c21f4197b6f10de047c3d3cfd /src/bytecode.c
parent11bcbbea88466f75990314f58dcc66cbf76ab75b (diff)
downloadcolm-984e6fb6cf25eee7dafe59db2be6b31b3c7c4b26.tar.gz
added a get option to retrieve auto_trim from bytecode
Diffstat (limited to 'src/bytecode.c')
-rw-r--r--src/bytecode.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/bytecode.c b/src/bytecode.c
index fbb94646..c5f8f313 100644
--- a/src/bytecode.c
+++ b/src/bytecode.c
@@ -209,10 +209,12 @@ static word_t stream_append_text( program_t *prg, tree_t **sp, input_t *dest, tr
assert(false);
}
else {
+ int auto_trim = impl->funcs->get_option( prg, impl, 0 );
+
/* Collect the tree data. */
str_collect_t collect;
init_str_collect( &collect );
- colm_print_tree_collect( prg, sp, &collect, input, ((struct input_impl_seq*)impl)->auto_trim );
+ colm_print_tree_collect( prg, sp, &collect, input, auto_trim );
/* Load it into the input. */
impl->funcs->append_data( prg, impl, collect.data, collect.length );
@@ -2327,7 +2329,8 @@ again:
stream_t *stream = vm_pop_stream();
struct stream_impl *si = stream_to_impl( stream );
- si->funcs->print_tree( prg, sp, si, to_send, false );
+ int auto_trim = si->funcs->get_option( prg, si, 0 );
+ si->funcs->print_tree( prg, sp, si, to_send, auto_trim );
vm_push_stream( stream );
colm_tree_downref( prg, sp, to_send );
break;
@@ -2517,7 +2520,7 @@ again:
value_t auto_trim = vm_pop_value();
struct stream_impl *si = stream->impl;
- si->funcs->auto_trim( prg, si, (long) auto_trim );
+ si->funcs->set_option( prg, si, 0, (long) auto_trim );
vm_push_stream( stream );
break;
@@ -2529,7 +2532,7 @@ again:
value_t auto_trim = vm_pop_value();
struct input_impl *ii = input->impl;
- ii->funcs->auto_trim( prg, ii, (long) auto_trim );
+ ii->funcs->set_option( prg, ii, 0, (long) auto_trim );
vm_push_input( input );
break;