uint8_t is_open = F_false;
// 0x0 = false, 0x1 = true, 0x2 = false, but there is a delimited comment, comment_delimit is set.
- uint8_t graph_first = 0x0;
+ uint8_t graph_first = 0x1;
// Initialize depth 1 start position.
// Positions_start.used is used as a max depth (such that cache->positions->used == max depth + 1).
newline_last = range->start;
position_previous = range->start++;
graph_first = 0x1;
+ line_start = range->start;
if (depth) {
if (range->start >= buffer.used || range->start > range->stop) {
}
}
- line_start = range->start;
-
continue;
}
if (buffer.string[range->start] == f_fss_eol_s.string[0]) {
newline_last = range->start;
line_start = range->start + 1;
+ graph_first = 0x1;
break;
}
}
}
else if (buffer.string[range->start] == f_fss_embedded_list_close_s.string[0]) {
- graph_first = 0x0;
-
while (range->start <= range->stop && range->start < buffer.used) {
if (state->interrupt) {
}
}
else if (graph_first == 0x1 && buffer.string[range->start] == f_fss_comment_s.string[0]) {
- position = newline_last + 1;
- f_fss_seek_to_eol(buffer, range, state);
- if (F_status_is_error(state->status)) break;
+ // The newline_last is initialized to the range->start, which may not actually be a new line.
+ position = (buffer.string[newline_last] == f_string_eol_s.string[0]) ? newline_last + 1 : newline_last;
- state->status = f_memory_array_increase(state->step_small, sizeof(f_range_t), (void **) &comments->array, &comments->used, &comments->size);
+ f_fss_seek_to_eol(buffer, range, state);
if (F_status_is_error(state->status)) break;
if (range->start > range->stop || range->start >= buffer.used) {
graph_first = 0x1;
}
+ state->status = f_memory_array_increase(state->step_small, sizeof(f_range_t), (void **) &comments->array, &comments->used, &comments->size);
+ if (F_status_is_error(state->status)) break;
+
comments->array[comments->used].start = position;
comments->array[comments->used++].stop = range->start++;
const f_number_unsigned_t destination_used = destination->used;
- bool is_comment = F_false;
- bool ends_on_eol = F_false;
- bool has_graph = F_false;
- bool do_prepend = prepend ? F_true : F_false;
+ uint8_t is_comment = F_false;
+ uint8_t ends_on_eol = F_false;
+ uint8_t has_graph = F_false;
+ uint8_t do_prepend = prepend ? F_true : F_false;
+ uint8_t width = 0;
f_number_unsigned_t i = 0;
+ f_number_unsigned_t r = 0;
f_number_unsigned_t slash_count = 0;
f_number_unsigned_t start = 0;
- f_number_unsigned_t r = 0;
-
- uint8_t width = 0;
-
while (range->start <= range->stop && range->start < content.used) {
if (state->interrupt) {
// The process_load() callback is required to be non-NULL.
if (!main->callback.process_load) return;
+ // This standard does not support multiple select, so any select greater than 0 can be predicted without processing the buffer.
+ if ((main->setting.flag & fss_read_main_flag_select_d) && main->setting.select) {
+ if (main->setting.flag & fss_read_main_flag_total_d) {
+ fss_read_print_number(&main->program.output, 0);
+ }
+
+ main->setting.state.status = F_okay;
+
+ return;
+ }
+
// @todo this now needs to handle this case: main->setting.flag & fss_read_main_flag_depth_multiple_d and this case main->setting.flag & fss_read_main_flag_select_d.
if (main->setting.buffer.used) {