From: Kevin Day Date: Tue, 7 Jan 2025 01:38:49 +0000 (-0600) Subject: Update: Finish fixing iki_read for runtime tests. X-Git-Tag: 0.7.0~2 X-Git-Url: https://git.kevux.org/?a=commitdiff_plain;h=44f156c5b09506bb9bd0549b899cc67705f21d7d;p=fll Update: Finish fixing iki_read for runtime tests. The iki_read must still print the unmatched variables. The `iki_read_process_line()` is indeed still valid to have. The total should still be printed even when there is no data or the start range is out of range. This ensures that a 0 is printed in these situations. There may or may not be eki_read fixes needed but runtime tests do not exist for that yet. A follow up commit shall address this. --- diff --git a/level_3/iki_read/c/eki/process.c b/level_3/iki_read/c/eki/process.c index 3d66ae3..a08eb1c 100644 --- a/level_3/iki_read/c/eki/process.c +++ b/level_3/iki_read/c/eki/process.c @@ -560,6 +560,11 @@ extern "C" { main->callback.print_data(&main->program.output, j); } } + else { + + // Unmatched names are printed as-is (the entire variable). + f_print_dynamic_partial(main->cache.buffer, data->variable.array[j], main->program.output.to); + } } else if (main->setting.flag & iki_read_main_flag_at_d) { if (at++ == main->setting.at) { @@ -610,7 +615,7 @@ extern "C" { f_range_t range = macro_f_range_t_initialize_2(main->cache.buffer.used); - iki_read_process_line(main, &range); // @fixme is this valid here anymore? + iki_read_process_line(main, &range); if (main->setting.state.status == F_true || main->setting.state.status == F_data_not) { if (main->setting.state.status == F_data_not || range.start > main->cache.buffer.used) { diff --git a/level_3/iki_read/c/iki/process.c b/level_3/iki_read/c/iki/process.c index 429278b..489ca45 100644 --- a/level_3/iki_read/c/iki/process.c +++ b/level_3/iki_read/c/iki/process.c @@ -511,6 +511,11 @@ extern "C" { main->callback.print_data(&main->program.output, j); } } + else { + + // Unmatched names are printed as-is (the entire variable). + f_print_dynamic_partial(main->cache.buffer, data->variable.array[j], main->program.output.to); + } } else if (main->setting.flag & iki_read_main_flag_at_d) { if (at++ == main->setting.at) { @@ -561,7 +566,7 @@ extern "C" { f_range_t range = macro_f_range_t_initialize_2(main->cache.buffer.used); - iki_read_process_line(main, &range); // @fixme is this valid here anymore? + iki_read_process_line(main, &range); if (main->setting.state.status == F_true || main->setting.state.status == F_data_not) { if (main->setting.state.status == F_data_not || range.start > main->cache.buffer.used) { diff --git a/level_3/iki_read/c/main/process.c b/level_3/iki_read/c/main/process.c index c9f87a6..d6bac31 100644 --- a/level_3/iki_read/c/main/process.c +++ b/level_3/iki_read/c/main/process.c @@ -14,12 +14,6 @@ extern "C" { if (main->setting.flag & iki_read_main_flag_whole_d) { iki_read_process_line(main, &buffer_range); - if (main->setting.state.status == F_data_not || main->setting.state.status == F_true && buffer_range.start > main->cache.buffer.used) { - main->setting.state.status = F_data_not; - - return; - } - if (main->setting.flag & iki_read_main_flag_total_d) { if (main->callback.process_buffer_total) { main->callback.process_buffer_total(main); @@ -32,6 +26,12 @@ extern "C" { return; } + if (main->setting.state.status == F_data_not || main->setting.state.status == F_true && buffer_range.start > main->cache.buffer.used) { + main->setting.state.status = F_data_not; + + return; + } + if (main->callback.process_buffer_ranges_whole) { main->callback.process_buffer_ranges_whole(main, &buffer_range); }