From: Kevin Day Date: Fri, 16 Oct 2026 03:36:30 +0000 (-0500) Subject: Progress: Additional fixes based on unit tests. X-Git-Url: https://git.kevux.org/?a=commitdiff_plain;h=e1149bf404723b7a0312970d92403ef514cc6f89;p=fll Progress: Additional fixes based on unit tests. --- diff --git a/level_1/fl_fss/c/fss/basic.c b/level_1/fl_fss/c/fss/basic.c index 10de92989..35bba7b21 100644 --- a/level_1/fl_fss/c/fss/basic.c +++ b/level_1/fl_fss/c/fss/basic.c @@ -48,6 +48,8 @@ extern "C" { } if (F_status_is_error_not(state->status)) { + state->status = f_memory_array_increase(state->step_small, sizeof(f_range_t), (void **) &found->array, &found->used, &found->size); + if (F_status_is_error(state->status)) return; // The EOS and stop cases only happen here when EOL is not found, so do not increment found.used. if (range->start >= buffer.used) { diff --git a/level_1/fl_fss/c/fss/basic_list.c b/level_1/fl_fss/c/fss/basic_list.c index 412983d9f..b2efa9cfa 100644 --- a/level_1/fl_fss/c/fss/basic_list.c +++ b/level_1/fl_fss/c/fss/basic_list.c @@ -42,6 +42,9 @@ extern "C" { #define ___fl_flag_has_graph_first___ 0x4 #define ___fl_flag_has_graph_first_delimit_comment___ 0x6 #define ___fl_flag_has_graph_first_do_escape___ 0x5 + #define ___fl_flag_has_line_first___ 0x8 + #define ___fl_flag_has_line_first_graph_first___ 0xc + #define ___fl_flag_has_line_first_delimit_comment___ 0xa const f_number_unsigned_t delimits_used = delimits->used; const f_number_unsigned_t comments_used = comments->used; @@ -56,7 +59,7 @@ extern "C" { f_number_unsigned_t slash_count = 0; f_number_unsigned_t line_start = begin; - uint8_t flag_fl = ___fl_flag_has_graph_first___; + uint8_t flag_fl = ___fl_flag_has_line_first_graph_first___; // The start position with a combining/joiner must be treated as Content and not as an Object. if (f_fss_is_combining_joiner(buffer, *range, state) == F_true) { @@ -65,7 +68,6 @@ extern "C" { if (F_status_is_error(state->status)) return; - // Identify where the content ends. while (range->start <= range->stop && range->start < buffer.used) { if (state->interrupt) { @@ -81,10 +83,10 @@ extern "C" { delimits->array[delimits->used++] = comment_delimit; } - newline_last = range->start; flag_fl |= ___fl_flag_has_graph_first___; - flag_fl &= ~___fl_flag_has_delimit_comment___; - ++range->start; + flag_fl &= ~___fl_flag_has_line_first_delimit_comment___; + newline_last = range->start; + line_start = ++range->start; // Any line that starts with a combining/joiner must be treated as Content and not as an Object. f_fss_skip_past_delimit(buffer, range, state); @@ -115,7 +117,6 @@ extern "C" { // If any slash has a combining/joiner following it, then there is no escaping at all for that slash and therefore it is not considered an escaping character. if (f_fss_is_combining_joiner(buffer, *range, state) == F_true) { flag_fl &= ~___fl_flag_has_graph_first_do_escape___; - slash_count = 0; f_fss_skip_past_combining_joiner(buffer, range, state); @@ -135,7 +136,7 @@ extern "C" { flag_fl &= ~___fl_flag_do_escape___; if (buffer.string[range->start] == f_fss_basic_list_open_s.string[0]) { - flag_fl &= ~___fl_flag_has_graph_first_delimit_comment___; + flag_fl &= ~___fl_flag_has_graph_first___; ++range->start; f_fss_skip_past_space(buffer, range, state); @@ -154,13 +155,15 @@ extern "C" { if (F_status_is_error(state->status) || range->start > range->stop || range->start >= buffer.used) break; if (state->status == F_okay_eol) { - newline_last = line_start; - line_start = range->start; + previous = range->start; range->start = slash_first; if (slash_count % 2 == 0) { + state->status = f_memory_array_increase(state->step_small, sizeof(f_range_t), (void **) &found->array, &found->used, &found->size); + if (F_status_is_error(state->status)) break; + found->array[found->used++].stop = newline_last; - range->start = newline_last + 1; + range->start = previous + 1; state->status = F_fss_found_content; return; @@ -185,15 +188,8 @@ extern "C" { if (F_status_is_error(state->status)) break; - if (flag_fl & ___fl_flag_has_delimit_comment___) { - state->status = f_memory_array_increase(state->step_small, sizeof(f_number_unsigned_t), (void **) &delimits->array, &delimits->used, &delimits->size); - if (F_status_is_error(state->status)) break; - - delimits->array[delimits->used++] = comment_delimit; - } - - flag_fl |= ___fl_flag_has_graph_first___; - range->start = line_start + 1; + range->start = previous; + state->status = F_okay_eol; } } else if ((flag_fl & ___fl_flag_has_graph_first___) && buffer.string[range->start] == f_fss_comment_s.string[0]) { @@ -210,7 +206,7 @@ extern "C" { else { if (F_status_is_error(state->status)) break; - flag_fl &= ___fl_flag_has_delimit_comment___; + flag_fl |= ___fl_flag_has_delimit_comment___; comment_delimit = slash_first; } } @@ -220,7 +216,7 @@ extern "C" { if (buffer.string[range->start] == f_fss_basic_list_open_s.string[0]) { ++range->start; - flag_fl &= ~___fl_flag_has_graph_first_delimit_comment___; + flag_fl &= ~___fl_flag_has_graph_first___; f_fss_skip_past_space(buffer, range, state); @@ -239,18 +235,28 @@ extern "C" { // Found a valid object, set stop point to last newline (if newline_last is begin, there newline_last is not a new line). if (state->status == F_okay_eol) { - if (begin != newline_last && newline_last == found->array[found->used].start) { + state->status = f_memory_array_increase(state->step_small, sizeof(f_range_t), (void **) &found->array, &found->used, &found->size); + if (F_status_is_error(state->status)) break; + + if (flag_fl & ___fl_flag_has_delimit_comment___) { + state->status = f_memory_array_increase(state->step_small, sizeof(f_number_unsigned_t), (void **) &delimits->array, &delimits->used, &delimits->size); + if (F_status_is_error(state->status)) break; + + delimits->array[delimits->used++] = comment_delimit; + } + + if (flag_fl & ___fl_flag_has_line_first___) { found->array[found->used].start = 1; found->array[found->used++].stop = 0; range->start = newline_last; + state->status = F_fss_found_content_not; } else { range->start = begin == newline_last ? newline_last : newline_last + 1; found->array[found->used++].stop = newline_last; + state->status = F_fss_found_content; } - state->status = F_fss_found_content; - return; } @@ -275,10 +281,9 @@ extern "C" { range->start = previous; - // The newline_last is initialized to the range->start, which may not actually be a new line. - line_start = buffer.string[newline_last] == f_string_eol_s.string[0] - ? newline_last + 1 - : newline_last; + line_start = flag_fl & ___fl_flag_has_line_first___ + ? begin + : newline_last + 1; f_fss_seek_to_eol(buffer, range, state); @@ -288,15 +293,10 @@ extern "C" { if (F_status_is_error(state->status)) break; - if (range->start > range->stop || range->start >= buffer.used) { - --range->start; - } - else { - newline_last = range->start; - } - comments->array[comments->used].start = line_start; - comments->array[comments->used++].stop = range->start++; + comments->array[comments->used++].stop = range->start; + newline_last = range->start; + state->status = F_okay_eol; continue; } @@ -305,7 +305,7 @@ extern "C" { if (f_fss_is_space(buffer, *range, state) == F_false) { if (F_status_is_error(state->status)) break; - flag_fl &= ~___fl_flag_has_graph_first_delimit_comment___; + flag_fl &= ~___fl_flag_has_graph_first___; } } @@ -313,6 +313,14 @@ extern "C" { if (F_status_is_error(state->status)) break; } // while + if (flag_fl & ___fl_flag_has_delimit_comment___) { + state->status = f_memory_array_increase(state->step_small, sizeof(f_number_unsigned_t), (void **) &delimits->array, &delimits->used, &delimits->size); + + if (F_status_is_error_not(state->status)) { + delimits->array[delimits->used++] = comment_delimit; + } + } + if (F_status_is_error(state->status)) { delimits->used = delimits_used; comments->used = comments_used; @@ -320,6 +328,9 @@ extern "C" { return; } + state->status = f_memory_array_increase(state->step_small, sizeof(f_range_t), (void **) &found->array, &found->used, &found->size); + if (F_status_is_error(state->status)) return; + // The EOS and stop cases only happen here when the next object is not found, so do not increment found.used and let caller handle. if (range->start >= buffer.used) { found->array[found->used].stop = buffer.used - 1; @@ -335,20 +346,25 @@ extern "C" { return; } - state->status = F_fss_found_content; + if (flag_fl & ___fl_flag_has_line_first___) { + state->status = F_fss_found_content_not; - if (range->start > begin) { - found->array[found->used++].stop = range->start - 1; - } - else { found->array[found->used].start = 1; found->array[found->used++].stop = 0; } + else { + state->status = F_fss_found_content; + + found->array[found->used++].stop = range->start - 1; + } #undef ___fl_flag_do_escape___ #undef ___fl_flag_has_delimit_comment___ #undef ___fl_flag_has_graph_first___ #undef ___fl_flag_has_graph_first_delimit_comment___ + #undef ___fl_flag_has_graph_first_do_escape___ + #undef ___fl_flag_has_line_first___ + #undef ___fl_flag_has_line_first_graph_first___ } #endif // _di_fl_fss_basic_list_content_read_ diff --git a/level_1/fl_fss/c/fss/basic_list.h b/level_1/fl_fss/c/fss/basic_list.h index f29cac941..b6d7165b6 100644 --- a/level_1/fl_fss/c/fss/basic_list.h +++ b/level_1/fl_fss/c/fss/basic_list.h @@ -77,7 +77,7 @@ extern "C" { * * This alters state.status: * F_fss_found_content on success and Content is found (start location is at end of Content). - * F_fss_found_content_not on success and no Content is found (start location is after character designating this is not a Content). + * F_fss_found_content_not on success and no Content is found or a valid Object is found before any Content is found (start location is after the character designating this is not a Content). * F_okay_eos on success after reaching the end of the buffer (a valid Object is not yet confirmed). * F_okay_stop on success after reaching stopping point (a valid Object is not yet confirmed). * F_data_not if buffer is empty (buffer.used is 0). @@ -92,6 +92,7 @@ extern "C" { * Errors (with error bit) from: f_fss_is_space(). * Errors (with error bit) from: f_fss_seek_to_eol(). * Errors (with error bit) from: f_fss_skip_past_delimit(). + * Errors (with error bit) from: f_fss_skip_past_space(). * Errors (with error bit) from: f_memory_array_increase(). * Errors (with error bit) from: f_memory_array_increase_by(). * Errors (with error bit) from: f_utf_buffer_increment(). @@ -99,6 +100,7 @@ extern "C" { * @see f_fss_is_space() * @see f_fss_seek_to_eol() * @see f_fss_skip_past_delimit() + * @see f_fss_skip_past_space() * @see f_memory_array_increase() * @see f_memory_array_increase_by() * @see f_utf_buffer_increment() diff --git a/level_1/fl_fss/c/fss/extended.c b/level_1/fl_fss/c/fss/extended.c index 40f7febdd..aa21a4b55 100644 --- a/level_1/fl_fss/c/fss/extended.c +++ b/level_1/fl_fss/c/fss/extended.c @@ -64,13 +64,14 @@ extern "C" { } if (state->status == F_fss_found_object || state->status == F_fss_found_object_content_not) { - status = f_memory_array_increase(state->step_small, sizeof(f_range_t), (void **) &found->array, &found->used, &found->size); // The private function sets the error bit on unterminated quoted Object. if (state->status == F_status_set_error(F_fss_found_object_content_not)) { state->status = F_fss_found_object_content_not; } + status = f_memory_array_increase(state->step_small, sizeof(f_range_t), (void **) &found->array, &found->used, &found->size); + if (F_status_is_error_not(status) && quotes) { status = f_memory_array_increase(state->step_small, sizeof(uint8_t), (void **) "es->array, "es->used, "es->size); } diff --git a/level_1/fl_fss/c/fss/extended_list.c b/level_1/fl_fss/c/fss/extended_list.c index c3fc0bfad..f61e6b66c 100644 --- a/level_1/fl_fss/c/fss/extended_list.c +++ b/level_1/fl_fss/c/fss/extended_list.c @@ -207,6 +207,9 @@ extern "C" { // Found a valid content close, set stop point to last newline. if (state->status == F_okay_eol) { + state->status = f_memory_array_increase(state->step_small, sizeof(f_range_t), (void **) &found->array, &found->used, &found->size); + if (F_status_is_error(state->status)) break; + close->start = line_start; close->stop = range->start - 1; @@ -218,12 +221,11 @@ extern "C" { found->array[found->used++].stop = 0; state->status = F_fss_found_content_not; - - return; } - - found->array[found->used++].stop = newline_last; - state->status = F_fss_found_content; + else { + found->array[found->used++].stop = newline_last; + state->status = F_fss_found_content; + } return; } diff --git a/level_1/fl_fss/c/private-fss-list.c b/level_1/fl_fss/c/private-fss-list.c index 76652f9f6..353b2d0bd 100644 --- a/level_1/fl_fss/c/private-fss-list.c +++ b/level_1/fl_fss/c/private-fss-list.c @@ -32,9 +32,11 @@ extern "C" { // Ignore all comment lines. if (buffer.string[begin] == f_fss_comment_s.string[0]) { state->status = f_utf_buffer_increment(buffer, range, 1); - if (F_status_is_error(state->status)) return; - f_fss_skip_past_delimit(buffer, range, state); + if (F_status_is_error_not(state->status)) { + f_fss_skip_past_delimit(buffer, range, state); + } + if (F_status_is_error(state->status)) return; if (range->start >= buffer.used || range->start > range->stop) { @@ -94,53 +96,44 @@ extern "C" { slash_count = 1; flag_fl |= ___fl_flag_do_escape___; - f_fss_skip_past_delimit(buffer, range, state); - - // If first slash has a combining/joiner following it, then there is no escaping at all but this is not a valid escaping slash. - if (F_status_is_error_not(state->status) && f_fss_is_combining_joiner(buffer, *range, state) == F_true) { - flag_fl &= ~___fl_flag_do_escape___; - - f_fss_skip_past_combining_joiner(buffer, range, state); + if (flag_fl & ___fl_flag_has_graph_first___) { + line_start = slash_first; } - if (flag_fl & ___fl_flag_do_escape___) { - while (F_status_is_error_not(state->status) && range->start <= range->stop && range->start < buffer.used) { + // If any slash has a combining/joiner following it, then there is no escaping at all but this is not a valid escaping slash. + while (F_status_is_error_not(state->status) && range->start <= range->stop && range->start < buffer.used) { - if (state->interrupt) { - state->interrupt((void *) state, 0); - if (F_status_is_error(state->status)) break; - } + if (state->interrupt) { + state->interrupt((void *) state, 0); + if (F_status_is_error(state->status)) break; + } - if (buffer.string[range->start] == f_fss_placeholder_s.string[0]) { - // Do nothing. - } - else if (buffer.string[range->start] == f_fss_slash_s.string[0]) { - ++slash_count; - } - else if (f_fss_is_combining_joiner(buffer, *range, state) == F_true) { - flag_fl &= ~___fl_flag_do_escape___; + if (buffer.string[range->start] == f_fss_placeholder_s.string[0]) { + // Do nothing. + } + else if (buffer.string[range->start] == f_fss_slash_s.string[0]) { + ++slash_count; + } + else if (f_fss_is_combining_joiner(buffer, *range, state) == F_true) { + flag_fl &= ~___fl_flag_do_escape___; - f_fss_skip_past_combining_joiner(buffer, range, state); + f_fss_skip_past_combining_joiner(buffer, range, state); - break; - } - else { - break; - } + break; + } + else { + break; + } - if (F_status_is_error_not(state->status)) { - state->status = f_utf_buffer_increment(buffer, range, 1); - } - } // while - } + if (F_status_is_error_not(state->status)) { + state->status = f_utf_buffer_increment(buffer, range, 1); + } + } // while if (F_status_is_error(state->status)) break; + if (!(flag_fl & ___fl_flag_do_escape___)) continue; - if (!(flag_fl & ___fl_flag_do_escape___)) { - slash_count = 0; - - continue; - } + flag_fl &= ~___fl_flag_do_escape___; if (range->start >= buffer.used || range->start > range->stop) { delimits->used = delimits_used; @@ -164,7 +157,6 @@ extern "C" { f_fss_skip_past_delimit(buffer, range, state); if (F_status_is_error_not(state->status) && f_fss_is_combining_joiner(buffer, *range, state) == F_true) { - flag_fl &= ~___fl_flag_do_escape___; slash_count = 0; f_fss_skip_past_combining_joiner(buffer, range, state); @@ -258,12 +250,11 @@ extern "C" { else if ((flag_fl & ___fl_flag_has_graph_first___) && buffer.string[range->start] == f_fss_comment_s.string[0]) { flag_fl &= ~___fl_flag_has_graph_first___; line_start = slash_first; - location = range->start++; + line_stop = location = range->start++; f_fss_skip_past_delimit(buffer, range, state); if (F_status_is_error_not(state->status) && f_fss_is_combining_joiner(buffer, *range, state) == F_true) { - flag_fl &= ~___fl_flag_do_escape___; slash_count = 0; f_fss_skip_past_combining_joiner(buffer, range, state); @@ -291,7 +282,11 @@ extern "C" { line_stop = range->start++; } else { - flag_fl &= ~___fl_flag_has_graph_first___; + if (flag_fl & ___fl_flag_has_graph_first___) { + flag_fl &= ~___fl_flag_has_graph_first___; + line_start = slash_first; + } + line_stop = range->start; } @@ -299,6 +294,10 @@ extern "C" { } if (buffer.string[range->start] == list_open.string[0]) { + if (flag_fl & ___fl_flag_has_graph_first___) { + line_start = range->start; + } + ++range->start; f_fss_skip_past_delimit(buffer, range, state); @@ -338,8 +337,15 @@ extern "C" { } if (state->status == F_okay_eol) { - found->start = line_start; - found->stop = line_stop + macro_f_utf_byte_width(buffer.string[line_stop]) - 1; + if (flag_fl & ___fl_flag_has_graph_first___) { + found->start = 1; + found->stop = 0; + } + else { + found->start = line_start; + found->stop = line_stop + macro_f_utf_byte_width(buffer.string[line_stop]) - 1; + } + ++range->start; state->status = F_fss_found_object; @@ -348,19 +354,21 @@ extern "C" { if (flag_fl & ___fl_flag_has_graph_first___) { flag_fl &= ~___fl_flag_has_graph_first___; - line_start = 1; - line_stop = 0; - } - else { - line_stop = range->start; + line_start = range->start; } + line_stop = range->start; + continue; } if (f_fss_is_space(buffer, *range, state) == F_false) { - if (F_status_is_error_not(state->status) && f_fss_is_combining_joiner(buffer, *range, state) == F_true) { - f_fss_skip_past_combining_joiner(buffer, range, state); + if ((flag_fl & ___fl_flag_has_graph_first___) && range->start > begin) { + if (F_status_is_error_not(state->status) && f_fss_is_combining_joiner(buffer, *range, state) == F_true) { + location = range->start; + + state->status = f_utf_buffer_decrement(buffer, range, 1); + } } if (F_status_is_error_not(state->status)) { diff --git a/level_1/fl_fss/c/private-fss.c b/level_1/fl_fss/c/private-fss.c index 3b6930801..072e3ad33 100644 --- a/level_1/fl_fss/c/private-fss.c +++ b/level_1/fl_fss/c/private-fss.c @@ -1332,7 +1332,7 @@ extern "C" { } // for } // for - // If there is no whitespace between the quotes, post-trimming, then remove the quotes. + // If there is no white space between the quotes, post-trimming, then remove the quotes. for (destination_range.start = front; destination_range.start < rear; ++destination_range.start) { if (state->interrupt) { diff --git a/level_2/fll_fss/c/fss/basic.c b/level_2/fll_fss/c/fss/basic.c index 191a5718e..7a89d79d4 100644 --- a/level_2/fll_fss/c/fss/basic.c +++ b/level_2/fll_fss/c/fss/basic.c @@ -41,6 +41,17 @@ extern "C" { } fl_fss_basic_object_read(buffer, range, &objects->array[objects->used], quoted_object, objects_delimits, state); + + // Skip lines with combining/joiners at the start. + if (F_status_set_fine(state->status) == F_complete_not_utf_start) { + f_fss_seek_to_eol(buffer, range, state); + + if (F_status_is_error_not(state->status)) { + state->status = F_fss_found_object_not; + continue; + } + } + if (F_status_is_error(state->status)) return; if (range->start >= range->stop || range->start >= buffer.used) { diff --git a/level_2/fll_fss/c/fss/basic.h b/level_2/fll_fss/c/fss/basic.h index 107e3ffd1..53039c782 100644 --- a/level_2/fll_fss/c/fss/basic.h +++ b/level_2/fll_fss/c/fss/basic.h @@ -79,10 +79,12 @@ extern "C" { * F_number_overflow (with error bit) if the maximum buffer size is reached. * F_parameter (with error bit) if a parameter is invalid. * + * Errors (with error bit) from: f_fss_seek_to_eol(). * Errors (with error bit) from: f_memory_array_increase(). * Errors (with error bit) from: fl_fss_basic_content_read(). * Errors (with error bit) from: fl_fss_basic_object_read(). * + * @see f_fss_seek_to_eol() * @see f_memory_array_increase() * @see fl_fss_basic_content_read() * @see fl_fss_basic_object_read() diff --git a/level_2/fll_fss/c/fss/basic_list.c b/level_2/fll_fss/c/fss/basic_list.c index 606a4ee14..6974c3b08 100644 --- a/level_2/fll_fss/c/fss/basic_list.c +++ b/level_2/fll_fss/c/fss/basic_list.c @@ -32,6 +32,17 @@ extern "C" { do { fl_fss_basic_list_object_read(buffer, range, &objects->array[objects->used], objects_delimits, state); + + // Skip lines with combining/joiners at the start. + if (F_status_set_fine(state->status) == F_complete_not_utf_start) { + f_fss_seek_to_eol(buffer, range, state); + + if (F_status_is_error_not(state->status)) { + state->status = F_fss_found_object_not; + continue; + } + } + if (F_status_is_error(state->status)) return; if (range->start >= range->stop || range->start >= buffer.used) { diff --git a/level_2/fll_fss/c/fss/basic_list.h b/level_2/fll_fss/c/fss/basic_list.h index bf9555cf9..def398c61 100644 --- a/level_2/fll_fss/c/fss/basic_list.h +++ b/level_2/fll_fss/c/fss/basic_list.h @@ -79,10 +79,12 @@ extern "C" { * F_number_overflow (with error bit) if the maximum buffer size is reached. * F_parameter (with error bit) if a parameter is invalid. * + * Errors (with error bit) from: f_fss_seek_to_eol(). * Errors (with error bit) from: f_memory_array_increase(). * Errors (with error bit) from: fl_fss_basic_list_content_read(). * Errors (with error bit) from: fl_fss_basic_list_object_read(). * + * @see f_fss_seek_to_eol() * @see f_memory_array_increase() * @see fl_fss_basic_list_content_read() * @see fl_fss_basic_list_object_read() diff --git a/level_2/fll_fss/c/fss/embedded_list.c b/level_2/fll_fss/c/fss/embedded_list.c index 059e6623c..e717421ea 100644 --- a/level_2/fll_fss/c/fss/embedded_list.c +++ b/level_2/fll_fss/c/fss/embedded_list.c @@ -35,6 +35,17 @@ extern "C" { nest->depth[nest->used].used = 0; fl_fss_embedded_list_object_read(buffer, range, &nest->depth[0].array[nest->depth[0].used].object, objects_delimits, state); + + // Skip lines with combining/joiners at the start. + if (F_status_set_fine(state->status) == F_complete_not_utf_start) { + f_fss_seek_to_eol(buffer, range, state); + + if (F_status_is_error_not(state->status)) { + state->status = F_fss_found_object_not; + continue; + } + } + if (F_status_is_error(state->status)) return; if (range->start >= range->stop || range->start >= buffer.used) { diff --git a/level_2/fll_fss/c/fss/embedded_list.h b/level_2/fll_fss/c/fss/embedded_list.h index 600e97bd7..a0ecc8ab2 100644 --- a/level_2/fll_fss/c/fss/embedded_list.h +++ b/level_2/fll_fss/c/fss/embedded_list.h @@ -77,10 +77,12 @@ extern "C" { * F_number_overflow (with error bit) if the maximum buffer size is reached. * F_parameter (with error bit) if a parameter is invalid. * + * Errors (with error bit) from: f_fss_seek_to_eol(). * Errors (with error bit) from: f_memory_array_increase(). * Errors (with error bit) from: fl_fss_embedded_list_content_read(). * Errors (with error bit) from: fl_fss_embedded_list_object_read(). * + * @see f_fss_seek_to_eol() * @see f_memory_array_increase() * @see fl_fss_embedded_list_content_read() * @see fl_fss_embedded_list_object_read() diff --git a/level_2/fll_fss/c/fss/extended.c b/level_2/fll_fss/c/fss/extended.c index bf1060882..029f557b0 100644 --- a/level_2/fll_fss/c/fss/extended.c +++ b/level_2/fll_fss/c/fss/extended.c @@ -49,6 +49,17 @@ extern "C" { } fl_fss_extended_object_read(buffer, range, &objects->array[objects->used], quoted_object, objects_delimits, state); + + // Skip lines with combining/joiners at the start. + if (F_status_set_fine(state->status) == F_complete_not_utf_start) { + f_fss_seek_to_eol(buffer, range, state); + + if (F_status_is_error_not(state->status)) { + state->status = F_fss_found_object_not; + continue; + } + } + if (F_status_is_error(state->status)) return; if (range->start >= range->stop || range->start >= buffer.used) { diff --git a/level_2/fll_fss/c/fss/extended.h b/level_2/fll_fss/c/fss/extended.h index 58236272f..f2bcab20a 100644 --- a/level_2/fll_fss/c/fss/extended.h +++ b/level_2/fll_fss/c/fss/extended.h @@ -83,10 +83,12 @@ extern "C" { * F_number_overflow (with error bit) if the maximum buffer size is reached. * F_parameter (with error bit) if a parameter is invalid. * + * Errors (with error bit) from: f_fss_seek_to_eol(). * Errors (with error bit) from: f_memory_array_increase(). * Errors (with error bit) from: fl_fss_extended_content_read(). * Errors (with error bit) from: fl_fss_extended_object_read(). * + * @see f_fss_seek_to_eol() * @see f_memory_array_increase() * @see fl_fss_extended_content_read() * @see fl_fss_extended_object_read() diff --git a/level_2/fll_fss/c/fss/extended_list.c b/level_2/fll_fss/c/fss/extended_list.c index 344987e40..70932d72e 100644 --- a/level_2/fll_fss/c/fss/extended_list.c +++ b/level_2/fll_fss/c/fss/extended_list.c @@ -34,6 +34,17 @@ extern "C" { do { fl_fss_extended_list_object_read(buffer, range, &objects->array[objects->used], objects_delimits, state); + + // Skip lines with combining/joiners at the start. + if (F_status_set_fine(state->status) == F_complete_not_utf_start) { + f_fss_seek_to_eol(buffer, range, state); + + if (F_status_is_error_not(state->status)) { + state->status = F_fss_found_object_not; + continue; + } + } + if (F_status_is_error(state->status)) return; if (range->start >= range->stop || range->start >= buffer.used) { diff --git a/level_2/fll_fss/c/fss/extended_list.h b/level_2/fll_fss/c/fss/extended_list.h index f75f0b23e..9a21c2f24 100644 --- a/level_2/fll_fss/c/fss/extended_list.h +++ b/level_2/fll_fss/c/fss/extended_list.h @@ -87,10 +87,12 @@ extern "C" { * F_number_overflow (with error bit) if the maximum buffer size is reached. * F_parameter (with error bit) if a parameter is invalid. * + * Errors (with error bit) from: f_fss_seek_to_eol(). * Errors (with error bit) from: f_memory_array_increase(). * Errors (with error bit) from: fl_fss_extended_list_content_read(). * Errors (with error bit) from: fl_fss_extended_list_object_read(). * + * @see f_fss_seek_to_eol() * @see f_memory_array_increase() * @see fl_fss_extended_list_content_read() * @see fl_fss_extended_list_object_read() diff --git a/level_2/fll_fss/c/fss/payload.c b/level_2/fll_fss/c/fss/payload.c index 92bb984b3..e150464df 100644 --- a/level_2/fll_fss/c/fss/payload.c +++ b/level_2/fll_fss/c/fss/payload.c @@ -41,6 +41,17 @@ extern "C" { do { fl_fss_basic_list_object_read(buffer, range, &objects->array[objects->used], objects_delimits, state); + + // Skip lines with combining/joiners at the start. + if (F_status_set_fine(state->status) == F_complete_not_utf_start) { + f_fss_seek_to_eol(buffer, range, state); + + if (F_status_is_error_not(state->status)) { + state->status = F_fss_found_object_not; + continue; + } + } + if (F_status_is_error(state->status)) return; if (range->start >= range->stop || range->start >= buffer.used) { diff --git a/level_2/fll_fss/c/fss/payload.h b/level_2/fll_fss/c/fss/payload.h index 4bf3e5107..8fa70e1b6 100644 --- a/level_2/fll_fss/c/fss/payload.h +++ b/level_2/fll_fss/c/fss/payload.h @@ -94,10 +94,12 @@ extern "C" { * * F_number_overflow (with error bit) if the maximum buffer size is reached. * + * Errors (with error bit) from: f_fss_seek_to_eol(). * Errors (with error bit) from: f_memory_array_increase(). * Errors (with error bit) from: fl_fss_basic_list_content_read(). * Errors (with error bit) from: fl_fss_basic_list_object_read(). * + * @see f_fss_seek_to_eol() * @see f_memory_array_increase() * @see fl_fss_basic_list_content_read() * @see fl_fss_basic_list_object_read()