From: Kevin Day Date: Thu, 22 Oct 2026 01:06:56 +0000 (-0500) Subject: Progress: Continue work. X-Git-Url: https://git.kevux.org/?a=commitdiff_plain;h=refs%2Fheads%2F0.8-combining;p=fll Progress: Continue work. Bring in the end content logic using flags that was used in the basic list content read. Fix the FSS Read unit tests where they have wrong data or need to start using the proper open and close characters. --- diff --git a/level_1/fl_fss/c/fss/basic_list.c b/level_1/fl_fss/c/fss/basic_list.c index b2efa9cfa..5b7c715d2 100644 --- a/level_1/fl_fss/c/fss/basic_list.c +++ b/level_1/fl_fss/c/fss/basic_list.c @@ -159,9 +159,6 @@ extern "C" { 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 = previous + 1; state->status = F_fss_found_content; @@ -235,9 +232,6 @@ 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) { - 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; @@ -328,9 +322,6 @@ 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; diff --git a/level_1/fl_fss/c/fss/extended_list.c b/level_1/fl_fss/c/fss/extended_list.c index f61e6b66c..5babafe95 100644 --- a/level_1/fl_fss/c/fss/extended_list.c +++ b/level_1/fl_fss/c/fss/extended_list.c @@ -37,7 +37,8 @@ extern "C" { 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; - #define ___fl_flag_has_slash___ 0x1 + #define ___fl_flag_has_line_first___ 0x1 + #define ___fl_flag_has_slash___ 0x2 const f_number_unsigned_t begin = range->start; const f_number_unsigned_t delimits_used = delimits->used; @@ -49,7 +50,7 @@ extern "C" { f_number_unsigned_t slash_first = 0; f_number_unsigned_t comment_start = 0; - uint8_t flag_fl = 0; + uint8_t flag_fl = ___fl_flag_has_line_first___; found->array[found->used].start = range->start; @@ -68,21 +69,24 @@ extern "C" { if (F_status_set_fine(state->status) == F_interrupt) break; } - f_fss_skip_past_space(buffer, range, state); + if (state->status != F_okay_eol) { + f_fss_skip_past_space(buffer, range, state); - // The skip space returns F_complete_not_utf_start with error bit set on combining/joiner. - if (F_status_set_fine(state->status) == F_complete_not_utf_start) { - f_fss_skip_past_combining_joiner(buffer, range, state); - if (F_status_is_error(state->status)) break; + // The skip space returns F_complete_not_utf_start with error bit set on combining/joiner. + if (F_status_set_fine(state->status) == F_complete_not_utf_start) { + f_fss_skip_past_combining_joiner(buffer, range, state); + if (F_status_is_error(state->status)) break; - continue; - } + continue; + } - if (F_status_is_error(state->status)) break; + if (F_status_is_error(state->status)) break; + } if (state->status == F_okay_eol) { newline_last = range->start++; line_start = range->start; + flag_fl &= ~___fl_flag_has_line_first___; // 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); @@ -150,13 +154,11 @@ extern "C" { if (range->start > range->stop || range->start >= buffer.used) break; if (state->status == F_okay_eol) { - newline_last = range->start; - line_start = range->start + 1; - 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++] = slash_first; + state->status = F_okay_eol; continue; } @@ -215,11 +217,9 @@ extern "C" { ++range->start; - // If the last newline is the entire start, then there is no Content (if newline_last is begin, there newline_last is not a new line). - if (begin != newline_last && newline_last == found->array[found->used].start) { + if (flag_fl & ___fl_flag_has_line_first___) { found->array[found->used].start = 1; found->array[found->used++].stop = 0; - state->status = F_fss_found_content_not; } else { @@ -266,6 +266,7 @@ extern "C" { comments->array[comments->used].start = comment_start; comments->array[comments->used++].stop = range->start++; + flag_fl &= ~___fl_flag_has_line_first___; continue; } @@ -284,6 +285,7 @@ extern "C" { state->status = F_fss_found_content_not; + #undef ___fl_flag_has_line_first___ #undef ___fl_flag_has_slash___ } #endif // _di_fl_fss_extended_list_content_read_ diff --git a/level_3/fss_read/tests/runtime/fss_0003/expect/test-0002-mixed-content-at-5.expect b/level_3/fss_read/tests/runtime/fss_0003/expect/test-0002-mixed-content-at-5.expect index 379654289..ab756b1e0 100644 --- a/level_3/fss_read/tests/runtime/fss_0003/expect/test-0002-mixed-content-at-5.expect +++ b/level_3/fss_read/tests/runtime/fss_0003/expect/test-0002-mixed-content-at-5.expect @@ -1,4 +1,4 @@ - not a list\: + not a list\{ a b привет c d привет мир a diff --git a/level_3/fss_read/tests/runtime/fss_0003/expect/test-0002-mixed-content-name-hi-select-0-empty.expect b/level_3/fss_read/tests/runtime/fss_0003/expect/test-0002-mixed-content-name-hi-select-0-empty.expect index 379654289..ab756b1e0 100644 --- a/level_3/fss_read/tests/runtime/fss_0003/expect/test-0002-mixed-content-name-hi-select-0-empty.expect +++ b/level_3/fss_read/tests/runtime/fss_0003/expect/test-0002-mixed-content-name-hi-select-0-empty.expect @@ -1,4 +1,4 @@ - not a list\: + not a list\{ a b привет c d привет мир a diff --git a/level_3/fss_read/tests/runtime/fss_0003/expect/test-0002-mixed-content-name-hi-select-0.expect b/level_3/fss_read/tests/runtime/fss_0003/expect/test-0002-mixed-content-name-hi-select-0.expect index 379654289..ab756b1e0 100644 --- a/level_3/fss_read/tests/runtime/fss_0003/expect/test-0002-mixed-content-name-hi-select-0.expect +++ b/level_3/fss_read/tests/runtime/fss_0003/expect/test-0002-mixed-content-name-hi-select-0.expect @@ -1,4 +1,4 @@ - not a list\: + not a list\{ a b привет c d привет мир a diff --git a/level_3/fss_read/tests/runtime/fss_0003/expect/test-0002-mixed-content-name-hi.expect b/level_3/fss_read/tests/runtime/fss_0003/expect/test-0002-mixed-content-name-hi.expect index 379654289..ab756b1e0 100644 --- a/level_3/fss_read/tests/runtime/fss_0003/expect/test-0002-mixed-content-name-hi.expect +++ b/level_3/fss_read/tests/runtime/fss_0003/expect/test-0002-mixed-content-name-hi.expect @@ -1,4 +1,4 @@ - not a list\: + not a list\{ a b привет c d привет мир a diff --git a/level_3/fss_read/tests/runtime/fss_0003/expect/test-0002-mixed-content-original.expect b/level_3/fss_read/tests/runtime/fss_0003/expect/test-0002-mixed-content-original.expect index 959ccee90..6fcdc4cb8 100644 --- a/level_3/fss_read/tests/runtime/fss_0003/expect/test-0002-mixed-content-original.expect +++ b/level_3/fss_read/tests/runtime/fss_0003/expect/test-0002-mixed-content-original.expect @@ -10,7 +10,7 @@ c d another "A" list. quoted, "yep". But this is not a comment. - not a list\: + not a list\{ a b привет c d привет мир a diff --git a/level_3/fss_read/tests/runtime/fss_0003/expect/test-0002-mixed-content-select-0-original.expect b/level_3/fss_read/tests/runtime/fss_0003/expect/test-0002-mixed-content-select-0-original.expect index 959ccee90..6fcdc4cb8 100644 --- a/level_3/fss_read/tests/runtime/fss_0003/expect/test-0002-mixed-content-select-0-original.expect +++ b/level_3/fss_read/tests/runtime/fss_0003/expect/test-0002-mixed-content-select-0-original.expect @@ -10,7 +10,7 @@ c d another "A" list. quoted, "yep". But this is not a comment. - not a list\: + not a list\{ a b привет c d привет мир a diff --git a/level_3/fss_read/tests/runtime/fss_0003/expect/test-0002-mixed-content-select-0.expect b/level_3/fss_read/tests/runtime/fss_0003/expect/test-0002-mixed-content-select-0.expect index 9c5c57b3d..a1571472a 100644 --- a/level_3/fss_read/tests/runtime/fss_0003/expect/test-0002-mixed-content-select-0.expect +++ b/level_3/fss_read/tests/runtime/fss_0003/expect/test-0002-mixed-content-select-0.expect @@ -10,7 +10,7 @@ c d another "A" list. quoted, "yep". But this is not a comment. - not a list\: + not a list\{ a b привет c d привет мир a diff --git a/level_3/fss_read/tests/runtime/fss_0003/expect/test-0002-mixed-content-trim.expect b/level_3/fss_read/tests/runtime/fss_0003/expect/test-0002-mixed-content-trim.expect index 9c5c57b3d..a1571472a 100644 --- a/level_3/fss_read/tests/runtime/fss_0003/expect/test-0002-mixed-content-trim.expect +++ b/level_3/fss_read/tests/runtime/fss_0003/expect/test-0002-mixed-content-trim.expect @@ -10,7 +10,7 @@ c d another "A" list. quoted, "yep". But this is not a comment. - not a list\: + not a list\{ a b привет c d привет мир a diff --git a/level_3/fss_read/tests/runtime/fss_0003/expect/test-0002-mixed-content.expect b/level_3/fss_read/tests/runtime/fss_0003/expect/test-0002-mixed-content.expect index 9c5c57b3d..a1571472a 100644 --- a/level_3/fss_read/tests/runtime/fss_0003/expect/test-0002-mixed-content.expect +++ b/level_3/fss_read/tests/runtime/fss_0003/expect/test-0002-mixed-content.expect @@ -10,7 +10,7 @@ c d another "A" list. quoted, "yep". But this is not a comment. - not a list\: + not a list\{ a b привет c d привет мир a diff --git a/level_3/fss_read/tests/runtime/fss_0003/expect/test-0002-mixed-object_and_content-at-5.expect b/level_3/fss_read/tests/runtime/fss_0003/expect/test-0002-mixed-object_and_content-at-5.expect index 07cd77f6d..b6f7815e4 100644 --- a/level_3/fss_read/tests/runtime/fss_0003/expect/test-0002-mixed-object_and_content-at-5.expect +++ b/level_3/fss_read/tests/runtime/fss_0003/expect/test-0002-mixed-object_and_content-at-5.expect @@ -1,5 +1,5 @@ hi{ - not a list\: + not a list\{ a b привет c d привет мир a diff --git a/level_3/fss_read/tests/runtime/fss_0003/expect/test-0002-mixed-object_and_content-name-hi-select-0-empty.expect b/level_3/fss_read/tests/runtime/fss_0003/expect/test-0002-mixed-object_and_content-name-hi-select-0-empty.expect index 07cd77f6d..b6f7815e4 100644 --- a/level_3/fss_read/tests/runtime/fss_0003/expect/test-0002-mixed-object_and_content-name-hi-select-0-empty.expect +++ b/level_3/fss_read/tests/runtime/fss_0003/expect/test-0002-mixed-object_and_content-name-hi-select-0-empty.expect @@ -1,5 +1,5 @@ hi{ - not a list\: + not a list\{ a b привет c d привет мир a diff --git a/level_3/fss_read/tests/runtime/fss_0003/expect/test-0002-mixed-object_and_content-name-hi-select-0.expect b/level_3/fss_read/tests/runtime/fss_0003/expect/test-0002-mixed-object_and_content-name-hi-select-0.expect index 07cd77f6d..b6f7815e4 100644 --- a/level_3/fss_read/tests/runtime/fss_0003/expect/test-0002-mixed-object_and_content-name-hi-select-0.expect +++ b/level_3/fss_read/tests/runtime/fss_0003/expect/test-0002-mixed-object_and_content-name-hi-select-0.expect @@ -1,5 +1,5 @@ hi{ - not a list\: + not a list\{ a b привет c d привет мир a diff --git a/level_3/fss_read/tests/runtime/fss_0003/expect/test-0002-mixed-object_and_content-name-hi.expect b/level_3/fss_read/tests/runtime/fss_0003/expect/test-0002-mixed-object_and_content-name-hi.expect index 07cd77f6d..b6f7815e4 100644 --- a/level_3/fss_read/tests/runtime/fss_0003/expect/test-0002-mixed-object_and_content-name-hi.expect +++ b/level_3/fss_read/tests/runtime/fss_0003/expect/test-0002-mixed-object_and_content-name-hi.expect @@ -1,5 +1,5 @@ hi{ - not a list\: + not a list\{ a b привет c d привет мир a diff --git a/level_3/fss_read/tests/runtime/fss_0003/expect/test-0002-mixed-object_and_content-original.expect b/level_3/fss_read/tests/runtime/fss_0003/expect/test-0002-mixed-object_and_content-original.expect index 36317e478..c1e4b2a41 100644 --- a/level_3/fss_read/tests/runtime/fss_0003/expect/test-0002-mixed-object_and_content-original.expect +++ b/level_3/fss_read/tests/runtime/fss_0003/expect/test-0002-mixed-object_and_content-original.expect @@ -21,7 +21,7 @@ a{ empty{ } hi{ - not a list\: + not a list\{ a b привет c d привет мир a diff --git a/level_3/fss_read/tests/runtime/fss_0003/expect/test-0002-mixed-object_and_content-select-0-original.expect b/level_3/fss_read/tests/runtime/fss_0003/expect/test-0002-mixed-object_and_content-select-0-original.expect index 36317e478..c1e4b2a41 100644 --- a/level_3/fss_read/tests/runtime/fss_0003/expect/test-0002-mixed-object_and_content-select-0-original.expect +++ b/level_3/fss_read/tests/runtime/fss_0003/expect/test-0002-mixed-object_and_content-select-0-original.expect @@ -21,7 +21,7 @@ a{ empty{ } hi{ - not a list\: + not a list\{ a b привет c d привет мир a diff --git a/level_3/fss_read/tests/runtime/fss_0003/expect/test-0002-mixed-object_and_content-select-0.expect b/level_3/fss_read/tests/runtime/fss_0003/expect/test-0002-mixed-object_and_content-select-0.expect index 8ac8e0e9e..9dc401ed7 100644 --- a/level_3/fss_read/tests/runtime/fss_0003/expect/test-0002-mixed-object_and_content-select-0.expect +++ b/level_3/fss_read/tests/runtime/fss_0003/expect/test-0002-mixed-object_and_content-select-0.expect @@ -21,7 +21,7 @@ a{ empty{ } hi{ - not a list\: + not a list\{ a b привет c d привет мир a diff --git a/level_3/fss_read/tests/runtime/fss_0003/expect/test-0002-mixed-object_and_content-trim.expect b/level_3/fss_read/tests/runtime/fss_0003/expect/test-0002-mixed-object_and_content-trim.expect index 8ac8e0e9e..9dc401ed7 100644 --- a/level_3/fss_read/tests/runtime/fss_0003/expect/test-0002-mixed-object_and_content-trim.expect +++ b/level_3/fss_read/tests/runtime/fss_0003/expect/test-0002-mixed-object_and_content-trim.expect @@ -21,7 +21,7 @@ a{ empty{ } hi{ - not a list\: + not a list\{ a b привет c d привет мир a diff --git a/level_3/fss_read/tests/runtime/fss_0003/expect/test-0002-mixed-object_and_content.expect b/level_3/fss_read/tests/runtime/fss_0003/expect/test-0002-mixed-object_and_content.expect index 8ac8e0e9e..9dc401ed7 100644 --- a/level_3/fss_read/tests/runtime/fss_0003/expect/test-0002-mixed-object_and_content.expect +++ b/level_3/fss_read/tests/runtime/fss_0003/expect/test-0002-mixed-object_and_content.expect @@ -21,7 +21,7 @@ a{ empty{ } hi{ - not a list\: + not a list\{ a b привет c d привет мир a diff --git a/level_3/fss_read/tests/runtime/fss_0003/source/test-0002-mixed.fss b/level_3/fss_read/tests/runtime/fss_0003/source/test-0002-mixed.fss index 1052a5402..4378e0dc2 100644 --- a/level_3/fss_read/tests/runtime/fss_0003/source/test-0002-mixed.fss +++ b/level_3/fss_read/tests/runtime/fss_0003/source/test-0002-mixed.fss @@ -26,7 +26,7 @@ hi\{ empty{ } hi{ - not a list\: + not a list\{ a b привет c d привет мир a