]> Kevux Git Server - fll/commitdiff
Progress: Clean up and start fixing problems.
authorKevin Day <Kevin@kevux.org>
Wed, 14 Oct 2026 01:40:18 +0000 (20:40 -0500)
committerKevin Day <Kevin@kevux.org>
Wed, 14 Oct 2026 01:52:46 +0000 (20:52 -0500)
Rename and restructure the fl_flags in basic list to be alphabetical.

Ensure the `___fl_flag_has_delimit_comment___` flag gets reset.
Ensure the `___fl_flag_do_escape___` flag gets reset.

Remove unnecessary assignment of `slash_count` to 0.

Remove unnecessary `> 0` check on while loop using `slash_count`.

Ensure `F_okay_eos` and `F_okay_stop` are correctly handled in tests.

level_1/fl_fss/c/fss/basic_list.c
level_1/fl_fss/tests/unit/c/test-fss-basic_list_content_read.c
level_1/fl_fss/tests/unit/c/test-fss-embedded_list_content_read.c

index 6b71714031995f073f4b114b3b6729fbdf56dc99..7c725b960eb5f61d62bfea5c118a92311a0e1987 100644 (file)
@@ -38,10 +38,10 @@ extern "C" {
     if (F_status_is_error(state->status)) return;
 
     #define ___fl_flag_do_escape___                       0x1
-    #define ___fl_flag_has_graph_first___                 0x2
-    #define ___fl_flag_has_graph_first_do_escape___       0x3
-    #define ___fl_flag_has_delimit_comment___             0x4
-    #define ___fl_flag_has_delimit_comment_graph_first___ 0x6
+    #define ___fl_flag_has_delimit_comment___             0x2
+    #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
 
     const f_number_unsigned_t delimits_used = delimits->used;
     const f_number_unsigned_t comments_used = comments->used;
@@ -76,6 +76,7 @@ extern "C" {
 
         newline_last = range->start;
         flag_fl |= ___fl_flag_has_graph_first___;
+        flag_fl &= ~___fl_flag_has_delimit_comment___;
         ++range->start;
 
         continue;
@@ -115,8 +116,10 @@ extern "C" {
         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 (buffer.string[range->start] == f_fss_basic_list_open_s.string[0]) {
-          flag_fl &= ~___fl_flag_has_delimit_comment_graph_first___;
+          flag_fl &= ~___fl_flag_has_graph_first_delimit_comment___;
           ++range->start;
 
           f_fss_skip_past_space(buffer, range, state);
@@ -124,7 +127,6 @@ extern "C" {
           // 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) {
             flag_fl &= ~___fl_flag_has_graph_first_do_escape___;
-            slash_count = 0;
 
             f_fss_skip_past_combining_joiner(buffer, range, state);
             if (F_status_is_error(state->status)) break;
@@ -151,7 +153,7 @@ extern "C" {
             state->status = f_memory_array_increase_by((slash_count / 2) + 1, sizeof(f_number_unsigned_t), (void **) &delimits->array, &delimits->used, &delimits->size);
             if (F_status_is_error(state->status)) break;
 
-            while (slash_count > 0) {
+            while (slash_count) {
 
               if (buffer.string[range->start] == f_fss_slash_s.string[0]) {
                 if (slash_count % 2 == 1) {
@@ -177,10 +179,6 @@ extern "C" {
             flag_fl |= ___fl_flag_has_graph_first___;
             range->start = line_start + 1;
           }
-          else {
-            flag_fl &= ~___fl_flag_do_escape___;
-            slash_count = 0;
-          }
         }
         else if ((flag_fl & ___fl_flag_has_graph_first___) && buffer.string[range->start] == f_fss_comment_s.string[0]) {
           ++range->start;
@@ -189,7 +187,6 @@ extern "C" {
 
           if (F_status_is_error_not(state->status) && 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);
             if (F_status_is_error(state->status)) break;
@@ -207,14 +204,13 @@ extern "C" {
 
       if (buffer.string[range->start] == f_fss_basic_list_open_s.string[0]) {
         ++range->start;
-        flag_fl &= ~___fl_flag_has_delimit_comment_graph_first___;
+        flag_fl &= ~___fl_flag_has_graph_first_delimit_comment___;
 
         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) {
           flag_fl &= ~___fl_flag_has_graph_first_do_escape___;
-          slash_count = 0;
 
           f_fss_skip_past_combining_joiner(buffer, range, state);
           if (F_status_is_error(state->status)) break;
@@ -252,7 +248,6 @@ extern "C" {
 
         if (F_status_is_error_not(state->status) && 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);
           if (F_status_is_error(state->status)) break;
@@ -294,7 +289,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_delimit_comment_graph_first___;
+          flag_fl &= ~___fl_flag_has_graph_first_delimit_comment___;
         }
       }
 
@@ -335,9 +330,9 @@ extern "C" {
     }
 
     #undef ___fl_flag_do_escape___
-    #undef ___fl_flag_has_graph_first___
     #undef ___fl_flag_has_delimit_comment___
-    #undef ___fl_flag_has_delimit_comment_graph_first___
+    #undef ___fl_flag_has_graph_first___
+    #undef ___fl_flag_has_graph_first_delimit_comment___
   }
 #endif // _di_fl_fss_basic_list_content_read_
 
index 183f6f2962a4c1eadd9393150605baa57fd2685f..0448bb61b9711b82bd931a828b1447057b26c597 100644 (file)
@@ -516,13 +516,13 @@ void test__fl_fss_basic_list_content_read__works_using_combining(void **void_sta
 
         fl_fss_basic_list_content_read(set_strings, &range, &found_content, &delimits, &comments, &state);
 
-        if (!(state.status == F_fss_found_content || state.status == F_data_not)) {
-          printf("[ -------> ] --- [11] Failure with fl_fss_basic_list_content_read(), with set %lu, status=%u, expected %u, or %u.\n", set, state.status, F_fss_found_content, F_data_not);
+        if (!(state.status == F_fss_found_content || state.status == F_okay_eos || state.status == F_okay_stop || state.status == F_data_not)) {
+          printf("[ -------> ] --- [11] Failure with fl_fss_basic_list_content_read(), with set %lu, status=%u, expected %u, %u, %u, or %u.\n", set, state.status, F_fss_found_content, F_okay_eos, F_okay_stop, F_data_not);
         }
 
-        assert_true(state.status == F_fss_found_content || state.status == F_data_not);
+        assert_true(state.status == F_fss_found_content || state.status == F_okay_eos || state.status == F_okay_stop || state.status == F_data_not);
 
-        if (state.status == F_fss_found_content) {
+        if (state.status == F_fss_found_content || state.status == F_okay_eos || state.status == F_okay_stop) {
           if (!found_content.used) {
             printf("[ -------> ] --- [12] Failure with fl_fss_basic_list_content_read(), with set %lu, expected found_content.used (%lu) <> 0.\n", set, found_content.used);
           }
index d5a6a1a64eacdc3ccf52381eb18f5fda033edf26..946ff5b76baa3f6547e5eb74b670d1bdc652276f 100644 (file)
@@ -537,13 +537,13 @@ void test__fl_fss_embedded_list_content_read__works_using_combining(void **void_
 
         fl_fss_embedded_list_content_read(set_strings, &range, &found_content, &delimits, &comments, &state);
 
-        if (!(state.status == F_fss_found_content || state.status == F_data_not)) {
-          printf("[ -------> ] --- [11] Failure with fl_fss_embedded_list_content_read(), with set %lu, status=%u, expected %u, or %u.\n", set, state.status, F_fss_found_content, F_data_not);
+        if (!(state.status == F_fss_found_content || state.status == F_okay_eos || state.status == F_okay_stop || state.status == F_data_not)) {
+          printf("[ -------> ] --- [11] Failure with fl_fss_embedded_list_content_read(), with set %lu, status=%u, expected %u, %u, %u, or %u.\n", set, state.status, F_fss_found_content, F_okay_eos, F_okay_stop, F_data_not);
         }
 
-        assert_true(state.status == F_fss_found_content || state.status == F_data_not);
+        assert_true(state.status == F_fss_found_content || state.status == F_okay_eos || state.status == F_okay_stop || state.status == F_data_not);
 
-        if (state.status == F_fss_found_content) {
+        if (state.status == F_fss_found_content || state.status == F_okay_eos || state.status == F_okay_stop) {
           if (!(found_content.used && found_content.depth[0].used && found_content.depth[0].array[0].content.used)) {
             printf(
               "[ -------> ] --- [12] Failure with fl_fss_embedded_list_content_read(), with set %lu, expected found_content.used (%lu) <> 0 or found_content.depth.used (%lu) <> 0 or found_content.depth[0].array[0].content.used (%lu) <> 0 <> 0.\n",