]> Kevux Git Server - fll/commitdiff
Progress: Continue work. 0.8-combining
authorKevin Day <Kevin@kevux.org>
Thu, 22 Oct 2026 01:06:56 +0000 (20:06 -0500)
committerKevin Day <Kevin@kevux.org>
Thu, 22 Oct 2026 01:06:56 +0000 (20:06 -0500)
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.

21 files changed:
level_1/fl_fss/c/fss/basic_list.c
level_1/fl_fss/c/fss/extended_list.c
level_3/fss_read/tests/runtime/fss_0003/expect/test-0002-mixed-content-at-5.expect
level_3/fss_read/tests/runtime/fss_0003/expect/test-0002-mixed-content-name-hi-select-0-empty.expect
level_3/fss_read/tests/runtime/fss_0003/expect/test-0002-mixed-content-name-hi-select-0.expect
level_3/fss_read/tests/runtime/fss_0003/expect/test-0002-mixed-content-name-hi.expect
level_3/fss_read/tests/runtime/fss_0003/expect/test-0002-mixed-content-original.expect
level_3/fss_read/tests/runtime/fss_0003/expect/test-0002-mixed-content-select-0-original.expect
level_3/fss_read/tests/runtime/fss_0003/expect/test-0002-mixed-content-select-0.expect
level_3/fss_read/tests/runtime/fss_0003/expect/test-0002-mixed-content-trim.expect
level_3/fss_read/tests/runtime/fss_0003/expect/test-0002-mixed-content.expect
level_3/fss_read/tests/runtime/fss_0003/expect/test-0002-mixed-object_and_content-at-5.expect
level_3/fss_read/tests/runtime/fss_0003/expect/test-0002-mixed-object_and_content-name-hi-select-0-empty.expect
level_3/fss_read/tests/runtime/fss_0003/expect/test-0002-mixed-object_and_content-name-hi-select-0.expect
level_3/fss_read/tests/runtime/fss_0003/expect/test-0002-mixed-object_and_content-name-hi.expect
level_3/fss_read/tests/runtime/fss_0003/expect/test-0002-mixed-object_and_content-original.expect
level_3/fss_read/tests/runtime/fss_0003/expect/test-0002-mixed-object_and_content-select-0-original.expect
level_3/fss_read/tests/runtime/fss_0003/expect/test-0002-mixed-object_and_content-select-0.expect
level_3/fss_read/tests/runtime/fss_0003/expect/test-0002-mixed-object_and_content-trim.expect
level_3/fss_read/tests/runtime/fss_0003/expect/test-0002-mixed-object_and_content.expect
level_3/fss_read/tests/runtime/fss_0003/source/test-0002-mixed.fss

index b2efa9cfabe5a161706043fdf5097e9600e4a82e..5b7c715d2fa7c208ae4841a0a8dbaedac081ef08 100644 (file)
@@ -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;
index f61e6b66c624aaede809efbe4a470e042745acf3..5babafe95afa595489aa3ff00e81504f466f0bde 100644 (file)
@@ -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_
index 37965428918585543bb062d01ee490092e5bbd38..ab756b1e044e9adf53a63cca54aa48070dafaf5b 100644 (file)
@@ -1,4 +1,4 @@
-  not a list\:
+  not a list\{
   a b привет
   c d
   привет мир a 
index 37965428918585543bb062d01ee490092e5bbd38..ab756b1e044e9adf53a63cca54aa48070dafaf5b 100644 (file)
@@ -1,4 +1,4 @@
-  not a list\:
+  not a list\{
   a b привет
   c d
   привет мир a 
index 959ccee90a5b2749f7aa926f70a00b71e2db4662..6fcdc4cb8673c7c4d5ab7ec2ea68c6dd8486bc11 100644 (file)
@@ -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 
index 959ccee90a5b2749f7aa926f70a00b71e2db4662..6fcdc4cb8673c7c4d5ab7ec2ea68c6dd8486bc11 100644 (file)
@@ -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 
index 9c5c57b3d21d40fcb62af9a31e73130d75905e34..a1571472af98ba53c22f6d62d57a523474c45760 100644 (file)
@@ -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 
index 9c5c57b3d21d40fcb62af9a31e73130d75905e34..a1571472af98ba53c22f6d62d57a523474c45760 100644 (file)
@@ -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 
index 9c5c57b3d21d40fcb62af9a31e73130d75905e34..a1571472af98ba53c22f6d62d57a523474c45760 100644 (file)
@@ -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 
index 36317e4786f5d26bca77fdb056f5d32f2895feba..c1e4b2a415aa9df3f021fcd1b3d01dc34ebbdfca 100644 (file)
@@ -21,7 +21,7 @@ a{
 empty{
 }
 hi{
-  not a list\:
+  not a list\{
   a b привет
   c d
   привет мир a 
index 8ac8e0e9e2c7fccb784d8dc579156dcdf8f9b9af..9dc401ed7d4596673aad0209351b6cdf8d64bfe2 100644 (file)
@@ -21,7 +21,7 @@ a{
 empty{
 }
 hi{
-  not a list\:
+  not a list\{
   a b привет
   c d
   привет мир a 
index 8ac8e0e9e2c7fccb784d8dc579156dcdf8f9b9af..9dc401ed7d4596673aad0209351b6cdf8d64bfe2 100644 (file)
@@ -21,7 +21,7 @@ a{
 empty{
 }
 hi{
-  not a list\:
+  not a list\{
   a b привет
   c d
   привет мир a 
index 8ac8e0e9e2c7fccb784d8dc579156dcdf8f9b9af..9dc401ed7d4596673aad0209351b6cdf8d64bfe2 100644 (file)
@@ -21,7 +21,7 @@ a{
 empty{
 }
 hi{
-  not a list\:
+  not a list\{
   a b привет
   c d
   привет мир a 
index 1052a54027c6c411ea1421ca641f0d5d9e18a726..4378e0dc2783658a46edc72b1861db9474212135 100644 (file)
@@ -26,7 +26,7 @@ hi\{
 empty{
 }
 hi{
-  not a list\:
+  not a list\{
   a b привет
   c d
   привет мир a