]> Kevux Git Server - fll/commitdiff
Progress: Continue working on write and related.
authorKevin Day <Kevin@kevux.org>
Tue, 27 Oct 2026 01:56:31 +0000 (20:56 -0500)
committerKevin Day <Kevin@kevux.org>
Tue, 27 Oct 2026 01:56:31 +0000 (20:56 -0500)
14 files changed:
level_0/f_fss/c/fss.c
level_0/f_fss/c/fss.h
level_1/fl_fss/c/fss/basic.h
level_1/fl_fss/c/fss/basic_list.c
level_1/fl_fss/c/fss/basic_list.h
level_1/fl_fss/c/fss/embedded_list.c
level_1/fl_fss/c/fss/embedded_list.h
level_1/fl_fss/c/fss/extended.h
level_1/fl_fss/c/fss/extended_list.c
level_1/fl_fss/c/fss/extended_list.h
level_1/fl_fss/c/private-fss-list.c
level_1/fl_fss/c/private-fss-list.h
level_1/fl_fss/c/private-fss.c
level_1/fl_fss/c/private-fss.h

index 3d31ba2..a0e5029 100644 (file)
@@ -159,7 +159,9 @@ extern "C" {
       return;
     }
 
-    while (range->start <= range->stop && range->start < buffer.used) {
+    const f_number_unsigned_t initial = *count;
+
+    for (; range->start <= range->stop && range->start < buffer.used; ++range->start) {
 
       if (state->interrupt) {
         state->interrupt((void *) state, 0);
@@ -167,16 +169,17 @@ extern "C" {
       }
 
       if (buffer.string[range->start] == f_fss_placeholder_s.string[0]) {
-        ++range->start;
-
-        continue;
+        // Do nothing.
       }
-
-      if (buffer.string[range->start] == f_fss_slash_s.string[0]) {
+      else if (buffer.string[range->start] == f_fss_slash_s.string[0]) {
         ++(*count);
       }
       else {
         if (private_f_fss_is_combining_joiner(buffer, *range, state) == F_true) {
+
+          // A combining joiner invalidates as slash immediately before it and there is only a preceding slash if count > initial.
+          if (*count > initial) --(*count);
+
           const f_status_t status = state->status;
 
           private_f_fss_skip_past_combining_joiner(buffer, range, state);
@@ -187,10 +190,7 @@ extern "C" {
 
         return;
       }
-
-      state->status = f_utf_buffer_increment(buffer, range, 1);
-      if (F_status_is_error(state->status)) return;
-    } // while
+    } // for
 
     if (range->start > range->stop) {
       state->status = F_okay_stop;
index f167c2e..bd811b9 100644 (file)
@@ -206,8 +206,6 @@ extern "C" {
  *
  *     F_interrupt (with error bit) if stopping due to an interrupt.
  *     F_parameter (with error bit) if a parameter is invalid.
- *
- *     Errors (with error bit) from f_utf_buffer_increment().
  */
 #ifndef _di_f_fss_count_slash_
   extern void f_fss_count_slash(const f_string_static_t buffer, f_range_t * const range, f_number_unsigned_t * const count, f_state_t * const state);
index 34457cf..304e6b7 100644 (file)
@@ -209,15 +209,18 @@ extern "C" {
  *     F_interrupt (with error bit) if stopping due to an interrupt.
  *     F_parameter (with error bit) if a parameter is invalid.
  *
+ *     Errors (with error bit) from: f_fss_count_slash().
  *     Errors (with error bit) from: f_fss_is_graph().
  *     Errors (with error bit) from: f_fss_is_space().
  *     Errors (with error bit) from: f_fss_is_zero_width().
  *     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_fss_slash_count().
  *     Errors (with error bit) from: f_memory_array_increase_by().
  *     Errors (with error bit) from: f_utf_buffer_increment().
  *
+ * @see f_fss_count_slash()
  * @see f_fss_is_graph()
  * @see f_fss_is_space()
  * @see f_fss_is_zero_width()
index 5b7c715..5518691 100644 (file)
@@ -105,35 +105,13 @@ extern "C" {
         slash_count = 1;
         flag_fl |= ___fl_flag_do_escape___;
 
-        for (; range->start <= range->stop && range->start < buffer.used; ++range->start) {
+        f_fss_count_slash(buffer, range, &slash_count, state);
+        if (F_status_is_error(state->status)) return;
 
-          if (state->interrupt) {
-            state->interrupt((void *) state, 0);
-            if (F_status_set_fine(state->status) == F_interrupt) break;
-          }
-
-          if (buffer.string[range->start] == f_fss_placeholder_s.string[0]) continue;
-
-          // 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___;
-
-            f_fss_skip_past_combining_joiner(buffer, range, state);
-
-            break;
-          }
-
-          if (F_status_is_error(state->status)) break;
-          if (buffer.string[range->start] != f_fss_slash_s.string[0]) break;
-
-          ++slash_count;
-        } // for
+        flag_fl &= ~___fl_flag_do_escape___;
 
-        if (F_status_is_error(state->status)) break;
         if (range->start > range->stop || range->start >= buffer.used) break;
-        if (!(flag_fl & ___fl_flag_do_escape___)) continue;
-
-        flag_fl &= ~___fl_flag_do_escape___;
+        if (state->status == F_combarudoo || state->status == F_bound) continue;
 
         if (buffer.string[range->start] == f_fss_basic_list_open_s.string[0]) {
           flag_fl &= ~___fl_flag_has_graph_first___;
@@ -895,24 +873,11 @@ extern "C" {
       if (object.string[range->start] == f_fss_slash_s.string[0]) {
         slash_count = 1;
 
-        for (++range->start; range->start <= range->stop && range->start < object.used; ++range->start) {
-
-          if (state->interrupt) {
-            state->interrupt((void *) state, 0);
-            if (F_status_set_fine(state->status) == F_interrupt) break;
-          }
-
-          if (object.string[range->start] == f_fss_placeholder_s.string[0]) continue;
-          if (object.string[range->start] != f_fss_slash_s.string[0]) break;
-
-          ++slash_count;
-        } // for
-
+        f_fss_count_slash(object, range, &slash_count, state);
         if (F_status_is_error(state->status)) break;
 
+        // Slashes at the end of the object must be delimited to avoid delimiting the object close character.
         if (range->start > range->stop || range->start >= object.used) {
-
-          // Slashes at the end of the object must be delimited to avoid delimiting the object close character.
           slash_count *= 2;
         }
 
index b6d7165..a3c8584 100644 (file)
@@ -240,6 +240,7 @@ extern "C" {
  *     F_interrupt (with error bit) if stopping due to an interrupt.
  *     F_parameter (with error bit) if a parameter is invalid.
  *
+ *     Errors (with error bit) from: f_fss_count_slash().
  *     Errors (with error bit) from: f_fss_is_graph().
  *     Errors (with error bit) from: f_fss_is_space().
  *     Errors (with error bit) from: f_fss_is_zero_width().
@@ -249,6 +250,7 @@ extern "C" {
  *     Errors (with error bit) from: f_memory_array_increase_by().
  *     Errors (with error bit) from: f_utf_buffer_increment().
  *
+ * @see f_fss_count_slash()
  * @see f_fss_is_graph()
  * @see f_fss_is_space()
  * @see f_fss_is_zero_width()
index 49c990a..ef97736 100644 (file)
@@ -1130,23 +1130,8 @@ extern "C" {
       if (object.string[range->start] == f_fss_slash_s.string[0]) {
         slash_count = 1;
 
-        for (++range->start; range->start <= range->stop && range->start < object.used; ++range->start) {
-
-          if (state->interrupt) {
-            state->interrupt((void *) state, 0);
-
-            if (F_status_set_fine(state->status) == F_interrupt) {
-              destination->used = destination_used;
-
-              return;
-            }
-          }
-
-          if (object.string[range->start] == f_fss_placeholder_s.string[0]) continue;
-          if (object.string[range->start] != f_fss_slash_s.string[0]) break;
-
-          ++slash_count;
-        } // for
+        f_fss_count_slash(object, range, &slash_count, state);
+        if (F_status_is_error(state->status)) return;
 
         if (range->start > range->stop || range->start >= object.used) {
 
index 58d42d8..d366e03 100644 (file)
@@ -285,6 +285,7 @@ extern "C" {
  *     F_interrupt (with error bit) if stopping due to an interrupt.
  *     F_parameter (with error bit) if a parameter is invalid.
  *
+ *     Errors (with error bit) from: f_fss_count_slash().
  *     Errors (with error bit) from: f_fss_is_graph().
  *     Errors (with error bit) from: f_fss_is_space().
  *     Errors (with error bit) from: f_fss_is_zero_width().
@@ -294,6 +295,7 @@ extern "C" {
  *     Errors (with error bit) from: f_memory_array_increase_by().
  *     Errors (with error bit) from: f_utf_buffer_increment().
  *
+ * @see f_fss_count_slash()
  * @see f_fss_is_graph()
  * @see f_fss_is_space()
  * @see f_fss_is_zero_width()
index 86d5621..b53cc2c 100644 (file)
@@ -87,6 +87,7 @@ extern "C" {
  *     F_interrupt (with error bit) if stopping due to an interrupt.
  *     F_parameter (with error bit) if a parameter is invalid.
  *
+ *     Errors (with error bit) from: f_fss_count_slash().
  *     Errors (with error bit) from: f_fss_is_graph().
  *     Errors (with error bit) from: f_fss_is_space().
  *     Errors (with error bit) from: f_fss_is_zero_width().
@@ -94,6 +95,7 @@ extern "C" {
  *     Errors (with error bit) from: f_fss_skip_past_space().
  *     Errors (with error bit) from: f_utf_buffer_increment().
  *
+ * @see f_fss_count_slash()
  * @see f_fss_is_graph()
  * @see f_fss_is_space()
  * @see f_fss_is_zero_width()
@@ -235,6 +237,7 @@ extern "C" {
  *     F_interrupt (with error bit) if stopping due to an interrupt.
  *     F_parameter (with error bit) if a parameter is invalid.
  *
+ *     Errors (with error bit) from: f_fss_count_slash().
  *     Errors (with error bit) from: f_fss_is_graph().
  *     Errors (with error bit) from: f_fss_is_space().
  *     Errors (with error bit) from: f_fss_is_zero_width().
@@ -243,6 +246,7 @@ extern "C" {
  *     Errors (with error bit) from: f_memory_array_increase().
  *     Errors (with error bit) from: f_utf_buffer_increment().
  *
+ * @see f_fss_count_slash()
  * @see f_fss_is_graph()
  * @see f_fss_is_space()
  * @see f_fss_is_zero_width()
index 5babafe..4b84b46 100644 (file)
@@ -871,23 +871,8 @@ extern "C" {
       if (object.string[range->start] == f_fss_slash_s.string[0]) {
         slash_count = 1;
 
-        for (++range->start; range->start <= range->stop && range->start < object.used; ++range->start) {
-
-          if (state->interrupt) {
-            state->interrupt((void *) state, 0);
-
-            if (F_status_set_fine(state->status) == F_interrupt) {
-              destination->used = destination_used;
-
-              return;
-            }
-          }
-
-          if (object.string[range->start] == f_fss_placeholder_s.string[0]) continue;
-          if (object.string[range->start] != f_fss_slash_s.string[0]) break;
-
-          ++slash_count;
-        } // for
+        f_fss_count_slash(object, range, &slash_count, state);
+        if (F_status_is_error(state->status)) return;
 
         if (range->start > range->stop || range->start >= object.used) {
 
index 41017ab..5a67368 100644 (file)
@@ -245,6 +245,7 @@ extern "C" {
  *     F_interrupt (with error bit) if stopping due to an interrupt.
  *     F_parameter (with error bit) if a parameter is invalid.
  *
+ *     Errors (with error bit) from: f_fss_count_slash().
  *     Errors (with error bit) from: f_fss_is_graph().
  *     Errors (with error bit) from: f_fss_is_space().
  *     Errors (with error bit) from: f_fss_is_zero_width().
@@ -254,6 +255,7 @@ extern "C" {
  *     Errors (with error bit) from: f_memory_array_increase_by().
  *     Errors (with error bit) from: f_utf_buffer_increment().
  *
+ * @see f_fss_count_slash()
  * @see f_fss_is_graph()
  * @see f_fss_is_space()
  * @see f_fss_is_zero_width()
index 353b2d0..f8c5c92 100644 (file)
@@ -100,38 +100,8 @@ extern "C" {
           line_start = slash_first;
         }
 
-        // 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 (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);
-
-            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(state->status)) break;
-        if (!(flag_fl & ___fl_flag_do_escape___)) continue;
+        f_fss_count_slash(buffer, range, &slash_count, state);
+        if (F_status_is_error(state->status)) return;
 
         flag_fl &= ~___fl_flag_do_escape___;
 
@@ -150,6 +120,8 @@ extern "C" {
           return;
         }
 
+        if (state->status == F_combarudoo || state->status == F_bound) continue;
+
         if (buffer.string[range->start] == list_open.string[0]) {
           flag_fl &= ~___fl_flag_has_graph_first___;
           line_stop = range->start++;
index 480e7ea..2dee2d5 100644 (file)
@@ -66,6 +66,7 @@ extern "C" {
  *     F_interrupt (with error bit) if stopping due to an interrupt.
  *     F_parameter (with error bit) if a parameter is invalid.
  *
+ *     Errors (with error bit) from: f_fss_count_slash().
  *     Errors (with error bit) from: f_fss_is_graph().
  *     Errors (with error bit) from: f_fss_is_space().
  *     Errors (with error bit) from: f_fss_is_zero_width().
@@ -75,6 +76,7 @@ extern "C" {
  *     Errors (with error bit) from: f_memory_array_increase_by().
  *     Errors (with error bit) from: f_utf_buffer_increment().
  *
+ * @see f_fss_count_slash()
  * @see f_fss_is_graph()
  * @see f_fss_is_space()
  * @see f_fss_is_zero_width()
index cc89b1e..d6ec550 100644 (file)
@@ -242,43 +242,10 @@ extern "C" {
 
           flag_fl &= ~___fl_flag_has_joiner_combining___;
 
-          while (range->start <= range->stop && range->start < buffer.used) {
+          f_fss_count_slash(buffer, range, &slash_count, state);
 
-            if (state->interrupt) {
-              state->interrupt((void *) state, 0);
-              if (F_status_set_fine(state->status) == F_interrupt) return;
-            }
-
-            if (buffer.string[range->start] == f_fss_placeholder_s.string[0]) {
-              ++range->start;
-
-              continue;
-            }
-
-            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) {
-                f_fss_skip_past_combining_joiner(buffer, range, state);
-
-                flag_fl |= ___fl_flag_has_joiner_combining___;
-              }
-
-              if (F_status_is_error(state->status)) return;
-
-              break;
-            }
-
-            state->status = f_utf_buffer_increment(buffer, range, 1);
-            if (F_status_is_error(state->status)) return;
-          } // while
-
-          if (flag_fl & ___fl_flag_has_joiner_combining___) {
-            flag_fl &= ~___fl_flag_has_joiner_combining___;
-
-            continue;
-          }
+          if (F_status_is_error(state->status)) return;
+          if (state->status == F_combarudoo || state->status == F_bound) continue;
 
           if (range->start >= buffer.used) {
             found->stop = buffer.used - 1;
@@ -394,8 +361,7 @@ extern "C" {
 
                   if (buffer.string[range->start] == f_fss_slash_s.string[0]) {
                     if (slash_count % 2 == 1) {
-                      delimits->array[delimits->used] = range->start;
-                      ++delimits->used;
+                      delimits->array[delimits->used++] = range->start;
                     }
 
                     --slash_count;
@@ -916,20 +882,8 @@ extern "C" {
         item_first = partial.start = range->start++;
         item_total = 1;
 
-        for (; range->start <= range->stop && range->start < object.used; ++range->start) {
-
-          if (state->interrupt) {
-            state->interrupt((void *) state, internal);
-            if (F_status_set_fine(state->status) == F_interrupt) break;
-          }
-
-          if (object.string[range->start] == f_fss_slash_s.string[0]) { // TODO: Verify no combining joiners following. Also, skip past slashes? Or count slashes function?
-            ++item_total;
-          }
-          else if (object.string[range->start] != f_fss_placeholder_s.string[0]) {
-            break;
-          }
-        } // for
+        f_fss_count_slash(object, range, &item_total, state);
+        if (F_status_is_error(state->status)) return;
 
         if (range->start > range->stop || range->start >= object.used) {
 
index 3981322..c1cf917 100644 (file)
@@ -76,6 +76,7 @@ extern "C" {
  *
  *     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_fss_count_slash().
  *     Errors (with error bit) from: f_fss_is_combining_joiner().
  *     Errors (with error bit) from: f_fss_is_graph().
  *     Errors (with error bit) from: f_fss_is_space().
@@ -89,6 +90,7 @@ extern "C" {
  *
  * @see f_memory_array_increase()
  * @see f_memory_array_increase_by()
+ * @see f_fss_count_slash()
  * @see f_fss_is_combining_joiner()
  * @see f_fss_is_graph()
  * @see f_fss_is_space()