]> Kevux Git Server - fll/commitdiff
Update: The FSS Lists (FSS-0002, FSS-0003, FSS-0008, etc..) to match recent specifica...
authorKevin Day <Kevin@kevux.org>
Sat, 31 Aug 2024 23:47:07 +0000 (18:47 -0500)
committerKevin Day <Kevin@kevux.org>
Sun, 1 Sep 2024 01:19:02 +0000 (20:19 -0500)
Update the Object read functions to be in compliance with the latest specification changes.
Review and update the code, fixing any observed problems and perform some clean ups.

I noticed that several of the list functions for Object read are almost identical.
Move this logic into into a shared private function to reduce repeated code.

The runtime tests are also updated.

I still need to review the Content read functions.
I probably may be able to also find similar, if not identical, code for the list write functions as well.
I will review the code and create a private function similar to what is done here if deemed possible and reasonable.

158 files changed:
level_1/fl_fss/c/fss/basic_list.c
level_1/fl_fss/c/fss/embedded_list.c
level_1/fl_fss/c/fss/extended.c
level_1/fl_fss/c/fss/extended_list.c
level_1/fl_fss/c/fss/macro.h
level_1/fl_fss/c/private-fss.c
level_1/fl_fss/c/private-fss.h
level_3/fss_embedded_list_read/c/private-read.c
level_3/fss_embedded_list_read/tests/runtime/fss_0008/expect/test-0000-basic-content-name-hi-select-0-empty-total.expect
level_3/fss_embedded_list_read/tests/runtime/fss_0008/expect/test-0000-basic-content-name-hi-select-0-empty.expect
level_3/fss_embedded_list_read/tests/runtime/fss_0008/expect/test-0000-basic-content-name-hi-select-0-total.expect
level_3/fss_embedded_list_read/tests/runtime/fss_0008/expect/test-0000-basic-content-name-hi-select-0.expect
level_3/fss_embedded_list_read/tests/runtime/fss_0008/expect/test-0000-basic-content-name-hi-total.expect
level_3/fss_embedded_list_read/tests/runtime/fss_0008/expect/test-0000-basic-content-name-hi.expect
level_3/fss_embedded_list_read/tests/runtime/fss_0008/expect/test-0000-basic-content-name-привет_has_space-select-0-total.expect
level_3/fss_embedded_list_read/tests/runtime/fss_0008/expect/test-0000-basic-content-name-привет_has_space-select-0.expect
level_3/fss_embedded_list_read/tests/runtime/fss_0008/expect/test-0000-basic-content-name-привет_has_space-total.expect
level_3/fss_embedded_list_read/tests/runtime/fss_0008/expect/test-0000-basic-content-name-привет_has_space.expect
level_3/fss_embedded_list_read/tests/runtime/fss_0008/expect/test-0000-basic-object-columns.expect
level_3/fss_embedded_list_read/tests/runtime/fss_0008/expect/test-0000-basic-object-line-0-original.expect
level_3/fss_embedded_list_read/tests/runtime/fss_0008/expect/test-0000-basic-object-line-1-original.expect
level_3/fss_embedded_list_read/tests/runtime/fss_0008/expect/test-0000-basic-object-line-5-original.expect
level_3/fss_embedded_list_read/tests/runtime/fss_0008/expect/test-0000-basic-object-line-6-original.expect
level_3/fss_embedded_list_read/tests/runtime/fss_0008/expect/test-0000-basic-object-name-a-columns-empty.expect
level_3/fss_embedded_list_read/tests/runtime/fss_0008/expect/test-0000-basic-object-name-a-columns.expect
level_3/fss_embedded_list_read/tests/runtime/fss_0008/expect/test-0000-basic-object-name-hi-select-0-empty-total.expect
level_3/fss_embedded_list_read/tests/runtime/fss_0008/expect/test-0000-basic-object-name-hi-select-0-empty.expect
level_3/fss_embedded_list_read/tests/runtime/fss_0008/expect/test-0000-basic-object-name-hi-select-0-total.expect
level_3/fss_embedded_list_read/tests/runtime/fss_0008/expect/test-0000-basic-object-name-hi-select-0.expect
level_3/fss_embedded_list_read/tests/runtime/fss_0008/expect/test-0000-basic-object-name-hi-total.expect
level_3/fss_embedded_list_read/tests/runtime/fss_0008/expect/test-0000-basic-object-name-hi.expect
level_3/fss_embedded_list_read/tests/runtime/fss_0008/expect/test-0000-basic-object-name-привет_has_space-select-0-total.expect
level_3/fss_embedded_list_read/tests/runtime/fss_0008/expect/test-0000-basic-object-name-привет_has_space-total.expect
level_3/fss_embedded_list_read/tests/runtime/fss_0008/expect/test-0000-basic-object-name-привет_has_space.expect
level_3/fss_embedded_list_read/tests/runtime/fss_0008/expect/test-0000-basic-object-original.expect
level_3/fss_embedded_list_read/tests/runtime/fss_0008/expect/test-0000-basic-object-select-0-original.expect
level_3/fss_embedded_list_read/tests/runtime/fss_0008/expect/test-0000-basic-object-select-0.expect
level_3/fss_embedded_list_read/tests/runtime/fss_0008/expect/test-0000-basic-object.expect
level_3/fss_embedded_list_read/tests/runtime/fss_0008/expect/test-0000-basic-object_and_content-line-0-original.expect
level_3/fss_embedded_list_read/tests/runtime/fss_0008/expect/test-0000-basic-object_and_content-line-1-original.expect
level_3/fss_embedded_list_read/tests/runtime/fss_0008/expect/test-0000-basic-object_and_content-line-5-original.expect
level_3/fss_embedded_list_read/tests/runtime/fss_0008/expect/test-0000-basic-object_and_content-line-6-original.expect
level_3/fss_embedded_list_read/tests/runtime/fss_0008/expect/test-0000-basic-object_and_content-name-hi-select-0-empty-total.expect
level_3/fss_embedded_list_read/tests/runtime/fss_0008/expect/test-0000-basic-object_and_content-name-hi-select-0-empty.expect
level_3/fss_embedded_list_read/tests/runtime/fss_0008/expect/test-0000-basic-object_and_content-name-hi-select-0-total.expect
level_3/fss_embedded_list_read/tests/runtime/fss_0008/expect/test-0000-basic-object_and_content-name-hi-select-0.expect
level_3/fss_embedded_list_read/tests/runtime/fss_0008/expect/test-0000-basic-object_and_content-name-hi-total.expect
level_3/fss_embedded_list_read/tests/runtime/fss_0008/expect/test-0000-basic-object_and_content-name-hi.expect
level_3/fss_embedded_list_read/tests/runtime/fss_0008/expect/test-0000-basic-object_and_content-name-привет_has_space-select-0-total.expect
level_3/fss_embedded_list_read/tests/runtime/fss_0008/expect/test-0000-basic-object_and_content-name-привет_has_space-select-0.expect
level_3/fss_embedded_list_read/tests/runtime/fss_0008/expect/test-0000-basic-object_and_content-name-привет_has_space-total.expect
level_3/fss_embedded_list_read/tests/runtime/fss_0008/expect/test-0000-basic-object_and_content-original.expect
level_3/fss_embedded_list_read/tests/runtime/fss_0008/expect/test-0000-basic-object_and_content-select-0-original.expect
level_3/fss_embedded_list_read/tests/runtime/fss_0008/expect/test-0000-basic-object_and_content-select-0.expect
level_3/fss_embedded_list_read/tests/runtime/fss_0008/expect/test-0000-basic-object_and_content.expect
level_3/fss_embedded_list_read/tests/runtime/fss_0008/expect/test-0001-empty_name_list-content-name-a-columns.expect
level_3/fss_embedded_list_read/tests/runtime/fss_0008/expect/test-0001-empty_name_list-object-columns.expect
level_3/fss_embedded_list_read/tests/runtime/fss_0008/expect/test-0001-empty_name_list-object-line-0-original.expect
level_3/fss_embedded_list_read/tests/runtime/fss_0008/expect/test-0001-empty_name_list-object-line-1-original.expect
level_3/fss_embedded_list_read/tests/runtime/fss_0008/expect/test-0001-empty_name_list-object-line-5-original.expect
level_3/fss_embedded_list_read/tests/runtime/fss_0008/expect/test-0001-empty_name_list-object-line-6-original.expect
level_3/fss_embedded_list_read/tests/runtime/fss_0008/expect/test-0001-empty_name_list-object-name-a-columns-empty.expect
level_3/fss_embedded_list_read/tests/runtime/fss_0008/expect/test-0001-empty_name_list-object-name-a-columns.expect
level_3/fss_embedded_list_read/tests/runtime/fss_0008/expect/test-0001-empty_name_list-object-name-a-original-empty.expect
level_3/fss_embedded_list_read/tests/runtime/fss_0008/expect/test-0001-empty_name_list-object-name-a-original.expect
level_3/fss_embedded_list_read/tests/runtime/fss_0008/expect/test-0001-empty_name_list-object-name-a-select-0-total.expect
level_3/fss_embedded_list_read/tests/runtime/fss_0008/expect/test-0001-empty_name_list-object-name-a-select-0.expect
level_3/fss_embedded_list_read/tests/runtime/fss_0008/expect/test-0001-empty_name_list-object-name-a-total.expect
level_3/fss_embedded_list_read/tests/runtime/fss_0008/expect/test-0001-empty_name_list-object-name-a.expect
level_3/fss_embedded_list_read/tests/runtime/fss_0008/expect/test-0001-empty_name_list-object-original.expect
level_3/fss_embedded_list_read/tests/runtime/fss_0008/expect/test-0001-empty_name_list-object-select-0-original.expect
level_3/fss_embedded_list_read/tests/runtime/fss_0008/expect/test-0001-empty_name_list-object-select-0.expect
level_3/fss_embedded_list_read/tests/runtime/fss_0008/expect/test-0001-empty_name_list-object.expect
level_3/fss_embedded_list_read/tests/runtime/fss_0008/expect/test-0001-empty_name_list-object_and_content-line-0-original.expect
level_3/fss_embedded_list_read/tests/runtime/fss_0008/expect/test-0001-empty_name_list-object_and_content-line-1-original.expect
level_3/fss_embedded_list_read/tests/runtime/fss_0008/expect/test-0001-empty_name_list-object_and_content-line-5-original.expect
level_3/fss_embedded_list_read/tests/runtime/fss_0008/expect/test-0001-empty_name_list-object_and_content-line-6-original.expect
level_3/fss_embedded_list_read/tests/runtime/fss_0008/expect/test-0001-empty_name_list-object_and_content-line-6.expect
level_3/fss_embedded_list_read/tests/runtime/fss_0008/expect/test-0001-empty_name_list-object_and_content-name-a-columns.expect
level_3/fss_embedded_list_read/tests/runtime/fss_0008/expect/test-0001-empty_name_list-object_and_content-name-a-original-empty.expect
level_3/fss_embedded_list_read/tests/runtime/fss_0008/expect/test-0001-empty_name_list-object_and_content-name-a-original.expect
level_3/fss_embedded_list_read/tests/runtime/fss_0008/expect/test-0001-empty_name_list-object_and_content-name-a-select-0-total.expect
level_3/fss_embedded_list_read/tests/runtime/fss_0008/expect/test-0001-empty_name_list-object_and_content-name-a-select-0.expect
level_3/fss_embedded_list_read/tests/runtime/fss_0008/expect/test-0001-empty_name_list-object_and_content-name-a-total.expect
level_3/fss_embedded_list_read/tests/runtime/fss_0008/expect/test-0001-empty_name_list-object_and_content-name-a.expect
level_3/fss_embedded_list_read/tests/runtime/fss_0008/expect/test-0001-empty_name_list-object_and_content-original.expect
level_3/fss_embedded_list_read/tests/runtime/fss_0008/expect/test-0001-empty_name_list-object_and_content-select-0-original.expect
level_3/fss_embedded_list_read/tests/runtime/fss_0008/expect/test-0001-empty_name_list-object_and_content-select-0.expect
level_3/fss_embedded_list_read/tests/runtime/fss_0008/expect/test-0001-empty_name_list-object_and_content.expect
level_3/fss_embedded_list_read/tests/runtime/fss_0008/expect/test-0002-mixed-object-at-6.expect
level_3/fss_embedded_list_read/tests/runtime/fss_0008/expect/test-0002-mixed-object-columns.expect
level_3/fss_embedded_list_read/tests/runtime/fss_0008/expect/test-0002-mixed-object-line-0-original.expect
level_3/fss_embedded_list_read/tests/runtime/fss_0008/expect/test-0002-mixed-object-line-1-original.expect
level_3/fss_embedded_list_read/tests/runtime/fss_0008/expect/test-0002-mixed-object-line-5-original.expect
level_3/fss_embedded_list_read/tests/runtime/fss_0008/expect/test-0002-mixed-object-line-6-original.expect
level_3/fss_embedded_list_read/tests/runtime/fss_0008/expect/test-0002-mixed-object-line-6.expect
level_3/fss_embedded_list_read/tests/runtime/fss_0008/expect/test-0002-mixed-object-name-a-columns-empty.expect
level_3/fss_embedded_list_read/tests/runtime/fss_0008/expect/test-0002-mixed-object-name-a-columns.expect
level_3/fss_embedded_list_read/tests/runtime/fss_0008/expect/test-0002-mixed-object-original.expect
level_3/fss_embedded_list_read/tests/runtime/fss_0008/expect/test-0002-mixed-object-select-0-original.expect
level_3/fss_embedded_list_read/tests/runtime/fss_0008/expect/test-0002-mixed-object-select-0.expect
level_3/fss_embedded_list_read/tests/runtime/fss_0008/expect/test-0002-mixed-object.expect
level_3/fss_embedded_list_read/tests/runtime/fss_0008/expect/test-0002-mixed-object_and_content-at-6.expect
level_3/fss_embedded_list_read/tests/runtime/fss_0008/expect/test-0002-mixed-object_and_content-line-0-original.expect
level_3/fss_embedded_list_read/tests/runtime/fss_0008/expect/test-0002-mixed-object_and_content-line-1-original.expect
level_3/fss_embedded_list_read/tests/runtime/fss_0008/expect/test-0002-mixed-object_and_content-line-5-original.expect
level_3/fss_embedded_list_read/tests/runtime/fss_0008/expect/test-0002-mixed-object_and_content-line-5.expect
level_3/fss_embedded_list_read/tests/runtime/fss_0008/expect/test-0002-mixed-object_and_content-line-6-original.expect
level_3/fss_embedded_list_read/tests/runtime/fss_0008/expect/test-0002-mixed-object_and_content-original.expect
level_3/fss_embedded_list_read/tests/runtime/fss_0008/expect/test-0002-mixed-object_and_content-select-0-original.expect
level_3/fss_embedded_list_read/tests/runtime/fss_0008/expect/test-0002-mixed-object_and_content-select-0.expect
level_3/fss_embedded_list_read/tests/runtime/fss_0008/expect/test-0002-mixed-object_and_content.expect
level_3/fss_extended_list_read/tests/runtime/fss_0003/expect/test-0000-basic-object-name-hi-select-0-empty.expect
level_3/fss_extended_list_read/tests/runtime/fss_0003/expect/test-0000-basic-object-name-hi-select-0.expect
level_3/fss_extended_list_read/tests/runtime/fss_0003/expect/test-0000-basic-object-name-hi.expect
level_3/fss_extended_list_read/tests/runtime/fss_0003/expect/test-0000-basic-object-name-привет_has_space.expect
level_3/fss_extended_list_read/tests/runtime/fss_0003/expect/test-0000-basic-object-original.expect
level_3/fss_extended_list_read/tests/runtime/fss_0003/expect/test-0000-basic-object-select-0-original.expect
level_3/fss_extended_list_read/tests/runtime/fss_0003/expect/test-0000-basic-object-select-0.expect
level_3/fss_extended_list_read/tests/runtime/fss_0003/expect/test-0000-basic-object.expect
level_3/fss_extended_list_read/tests/runtime/fss_0003/expect/test-0000-basic-object_and_content-name-hi-select-0-empty.expect
level_3/fss_extended_list_read/tests/runtime/fss_0003/expect/test-0000-basic-object_and_content-name-hi-select-0.expect
level_3/fss_extended_list_read/tests/runtime/fss_0003/expect/test-0000-basic-object_and_content-name-hi.expect
level_3/fss_extended_list_read/tests/runtime/fss_0003/expect/test-0000-basic-object_and_content-name-привет_has_space-select-0.expect
level_3/fss_extended_list_read/tests/runtime/fss_0003/expect/test-0000-basic-object_and_content-original.expect
level_3/fss_extended_list_read/tests/runtime/fss_0003/expect/test-0000-basic-object_and_content-select-0-original.expect
level_3/fss_extended_list_read/tests/runtime/fss_0003/expect/test-0000-basic-object_and_content-select-0.expect
level_3/fss_extended_list_read/tests/runtime/fss_0003/expect/test-0000-basic-object_and_content.expect
level_3/fss_extended_list_read/tests/runtime/fss_0003/expect/test-0001-empty_name_list-object-name-a-original-empty.expect
level_3/fss_extended_list_read/tests/runtime/fss_0003/expect/test-0001-empty_name_list-object-name-a-original.expect
level_3/fss_extended_list_read/tests/runtime/fss_0003/expect/test-0001-empty_name_list-object-name-a-select-0.expect
level_3/fss_extended_list_read/tests/runtime/fss_0003/expect/test-0001-empty_name_list-object-name-a.expect
level_3/fss_extended_list_read/tests/runtime/fss_0003/expect/test-0001-empty_name_list-object-original.expect
level_3/fss_extended_list_read/tests/runtime/fss_0003/expect/test-0001-empty_name_list-object-select-0-original.expect
level_3/fss_extended_list_read/tests/runtime/fss_0003/expect/test-0001-empty_name_list-object-select-0.expect
level_3/fss_extended_list_read/tests/runtime/fss_0003/expect/test-0001-empty_name_list-object.expect
level_3/fss_extended_list_read/tests/runtime/fss_0003/expect/test-0001-empty_name_list-object_and_content-line-6-original.expect
level_3/fss_extended_list_read/tests/runtime/fss_0003/expect/test-0001-empty_name_list-object_and_content-line-6.expect
level_3/fss_extended_list_read/tests/runtime/fss_0003/expect/test-0001-empty_name_list-object_and_content-name-a-original-empty.expect
level_3/fss_extended_list_read/tests/runtime/fss_0003/expect/test-0001-empty_name_list-object_and_content-name-a-original.expect
level_3/fss_extended_list_read/tests/runtime/fss_0003/expect/test-0001-empty_name_list-object_and_content-name-a-select-0.expect
level_3/fss_extended_list_read/tests/runtime/fss_0003/expect/test-0001-empty_name_list-object_and_content-name-a.expect
level_3/fss_extended_list_read/tests/runtime/fss_0003/expect/test-0001-empty_name_list-object_and_content-original.expect
level_3/fss_extended_list_read/tests/runtime/fss_0003/expect/test-0001-empty_name_list-object_and_content-select-0-original.expect
level_3/fss_extended_list_read/tests/runtime/fss_0003/expect/test-0001-empty_name_list-object_and_content-select-0.expect
level_3/fss_extended_list_read/tests/runtime/fss_0003/expect/test-0001-empty_name_list-object_and_content.expect
level_3/fss_extended_list_read/tests/runtime/fss_0003/expect/test-0002-mixed-object-at-6.expect
level_3/fss_extended_list_read/tests/runtime/fss_0003/expect/test-0002-mixed-object-line-6-original.expect
level_3/fss_extended_list_read/tests/runtime/fss_0003/expect/test-0002-mixed-object-line-6.expect
level_3/fss_extended_list_read/tests/runtime/fss_0003/expect/test-0002-mixed-object-original.expect
level_3/fss_extended_list_read/tests/runtime/fss_0003/expect/test-0002-mixed-object-select-0-original.expect
level_3/fss_extended_list_read/tests/runtime/fss_0003/expect/test-0002-mixed-object-select-0.expect
level_3/fss_extended_list_read/tests/runtime/fss_0003/expect/test-0002-mixed-object.expect
level_3/fss_extended_list_read/tests/runtime/fss_0003/expect/test-0002-mixed-object_and_content-at-6.expect
level_3/fss_extended_list_read/tests/runtime/fss_0003/expect/test-0002-mixed-object_and_content-original.expect
level_3/fss_extended_list_read/tests/runtime/fss_0003/expect/test-0002-mixed-object_and_content-select-0-original.expect
level_3/fss_extended_list_read/tests/runtime/fss_0003/expect/test-0002-mixed-object_and_content-select-0.expect
level_3/fss_extended_list_read/tests/runtime/fss_0003/expect/test-0002-mixed-object_and_content.expect

index db7873f62855d843274d2eeeda94f48b2c7d759b..efcd5ecea811f92dd3f98d3d664c8c5b5e1493b3 100644 (file)
@@ -68,10 +68,10 @@ extern "C" {
       }
 
       if (buffer.string[range->start] == f_fss_delimit_slash_s.string[0]) {
-        slash_first = range->start;
+        slash_first = range->start++;
         slash_count = 1;
 
-        for (++range->start; range->start <= range->stop && range->start < buffer.used; ++range->start) {
+        for (; range->start <= range->stop && range->start < buffer.used && (buffer.string[range->start] == f_fss_delimit_placeholder_s.string[0] || buffer.string[range->start] == f_fss_delimit_slash_s.string[0]); ++range->start) {
 
           if (state.interrupt) {
             status = state.interrupt((void *) &state, 0);
@@ -84,7 +84,6 @@ extern "C" {
           }
 
           if (buffer.string[range->start] == f_fss_delimit_placeholder_s.string[0]) continue;
-          if (buffer.string[range->start] != f_fss_delimit_slash_s.string[0]) break;
 
           ++slash_count;
         } // for
@@ -417,7 +416,7 @@ extern "C" {
 
             range->start = start + 1;
 
-            status = private_fl_fss_basic_list_write_add_until_end(content, state, range, destination);
+            status = private_fl_fss_list_write_add_until_end(content, state, range, destination);
             if (F_status_is_error(status)) break;
 
             continue;
@@ -458,7 +457,7 @@ extern "C" {
 
           range->start = start + 1;
 
-          status = private_fl_fss_basic_list_write_add_until_end(content, state, range, destination);
+          status = private_fl_fss_list_write_add_until_end(content, state, range, destination);
           if (F_status_is_error(status)) break;
 
           continue;
@@ -558,266 +557,7 @@ extern "C" {
       if (!delimits) return F_status_set_error(F_parameter);
     #endif // _di_level_1_parameter_checking_
 
-    const f_array_length_t delimits_used = delimits->used;
-
-    f_status_t status = f_fss_skip_past_space(state, buffer, range);
-    if (F_status_is_error(status)) return status;
-
-    if (status == F_none_eol) {
-
-      // Move the start position to after the EOL.
-      ++range->start;
-
-      return F_fss_found_object_not;
-    }
-
-    if (status == F_none_eos) return F_data_not_eos;
-    if (status == F_none_stop) return F_data_not_stop;
-
-    // Begin the search.
-    found->start = range->start;
-
-    // Ignore all comment lines.
-    if (buffer.string[range->start] == f_fss_comment_s.string[0]) {
-      found->start = 1;
-      found->stop = 0;
-
-      status = f_fss_seek_to_eol(state, buffer, range);
-      if (F_status_is_error(status)) return status;
-      if (status == F_none_eos) return F_data_not_eos;
-      if (status == F_none_stop) return F_data_not_stop;
-
-      // Move the start position to after the EOL.
-      ++range->start;
-
-      return F_fss_found_object_not;
-    }
-
-    f_array_length_t slash_first = 0;
-    f_array_length_t slash_count = 0;
-    f_array_length_t start = 1;
-    f_array_length_t stop = 0;
-
-    uint8_t graph_first = F_true;
-
-    // Identify where the object ends.
-    while (range->start <= range->stop && range->start < buffer.used && buffer.string[range->start] != f_fss_eol_s.string[0]) {
-
-      if (state.interrupt) {
-        status = state.interrupt((void *) &state, 0);
-
-        if (F_status_set_fine(status) == F_interrupt) {
-          status = F_status_set_error(F_interrupt);
-
-          break;
-        }
-      }
-
-      if (buffer.string[range->start] == f_fss_delimit_slash_s.string[0]) {
-        slash_first = range->start;
-        slash_count = 1;
-
-        for (++range->start; range->start <= range->stop && range->start < buffer.used; ++range->start) {
-
-          if (state.interrupt) {
-            status = state.interrupt((void *) &state, 0);
-
-            if (F_status_set_fine(status) == F_interrupt) {
-              status = F_status_set_error(F_interrupt);
-
-              break;
-            }
-          }
-
-          if (buffer.string[range->start] == f_fss_delimit_placeholder_s.string[0]) continue;
-          else if (buffer.string[range->start] != f_fss_delimit_slash_s.string[0]) break;
-
-          ++slash_count;
-        } // for
-
-        private_macro_fl_fss_object_return_on_overflow((buffer), (*range), (*found), (*delimits), delimits_used, F_data_not_eos, F_data_not_stop);
-
-        if (buffer.string[range->start] == f_fss_basic_list_open_s.string[0]) {
-          graph_first = F_false;
-
-          status = f_utf_buffer_increment(buffer, range, 1);
-          if (F_status_is_error(status)) return status;
-
-          while (range->start <= range->stop && range->start < buffer.used) {
-
-            if (state.interrupt) {
-              status = state.interrupt((void *) &state, 0);
-
-              if (F_status_set_fine(status) == F_interrupt) {
-                status = F_status_set_error(F_interrupt);
-
-                break;
-              }
-            }
-
-            if (buffer.string[range->start] == f_fss_eol_s.string[0]) break;
-
-            status = f_fss_is_space(state, buffer, *range);
-            if (F_status_is_error(status) || status == F_false) break;
-
-            status = f_utf_buffer_increment(buffer, range, 1);
-            if (F_status_is_error(status)) break;
-          } // while
-
-          private_macro_fl_fss_object_return_on_overflow((buffer), (*range), (*found), (*delimits), delimits_used, F_data_not_eos, F_data_not_stop);
-
-          if (buffer.string[range->start] == f_fss_eol_s.string[0]) {
-            found->stop = range->start;
-            range->start = slash_first;
-
-            status = f_array_lengths_increase_by((slash_count / 2) + 1, delimits);
-
-            if (F_status_is_error(status)) {
-              range->start = found->stop;
-
-              break;
-            }
-
-            if (slash_count % 2 == 0) {
-              while (slash_count > 0) {
-
-                if (buffer.string[range->start] == f_fss_delimit_slash_s.string[0]) {
-                  if (slash_count % 2 == 1) {
-                    delimits->array[delimits->used] = range->start;
-                    ++delimits->used;
-                  }
-
-                  --slash_count;
-                }
-
-                status = f_utf_buffer_increment(buffer, range, 1);
-
-                if (F_status_is_error(status)) {
-                  range->start = found->stop + 1;
-                  found->start = 1;
-                  found->stop = 0;
-                  delimits->used = delimits_used;
-
-                  return status;
-                }
-              } // while
-
-              range->start = found->stop + 1;
-              found->start = start;
-              found->stop = stop + macro_f_utf_byte_width(buffer.string[stop]) - 1;
-
-              return F_fss_found_object;
-            }
-
-            range->start = found->stop + 1;
-
-            return F_fss_found_object_not;
-          }
-        }
-        else if (graph_first && buffer.string[range->start] == f_fss_comment_s.string[0]) {
-          if (graph_first) {
-            graph_first = F_false;
-            start = slash_first;
-          }
-
-          // Comments may only have white space before the '#', therefore only the first slash needs to be delimited.
-          status = f_array_lengths_increase(state.step_small, delimits);
-          if (F_status_is_error(status)) break;
-
-          delimits->array[delimits->used++] = slash_first;
-          stop = range->start++;
-        }
-        else {
-          graph_first = F_false;
-          stop = range->start;
-        }
-
-        continue;
-      }
-
-      if (buffer.string[range->start] == f_fss_basic_list_open_s.string[0]) {
-        status = f_utf_buffer_increment(buffer, range, 1);
-        if (F_status_is_error(status)) break;
-
-        while (range->start <= range->stop && range->start < buffer.used) {
-
-          if (state.interrupt) {
-            status = state.interrupt((void *) &state, 0);
-
-            if (F_status_set_fine(status) == F_interrupt) {
-              status = F_status_set_error(F_interrupt);
-
-              break;
-            }
-          }
-
-          if (buffer.string[range->start] == f_fss_eol_s.string[0]) break;
-
-          status = f_fss_is_space(state, buffer, *range);
-          if (F_status_is_error(status) || status == F_false) break;
-
-          status = f_utf_buffer_increment(buffer, range, 1);
-          if (F_status_is_error(status)) break;
-        } // while
-
-        private_macro_fl_fss_object_return_on_overflow_delimited((buffer), (*range), (*found), F_none_eos, F_none_stop);
-
-        if (buffer.string[range->start] == f_fss_eol_s.string[0]) {
-          found->start = start;
-          found->stop = stop + macro_f_utf_byte_width(buffer.string[stop]) - 1;
-          ++range->start;
-
-          return F_fss_found_object;
-        }
-
-        if (graph_first) {
-          graph_first = F_false;
-          start = 1;
-          stop = 0;
-        }
-        else {
-          stop = range->start;
-        }
-
-        continue;
-      }
-      else {
-        status = f_fss_is_space(state, buffer, *range);
-        if (F_status_is_error(status)) break;
-
-        if (status == F_false) {
-          if (graph_first) {
-            graph_first = F_false;
-            start = range->start;
-          }
-
-          stop = range->start;
-        }
-      }
-
-      status = f_utf_buffer_increment(buffer, range, 1);
-      if (F_status_is_error(status)) break;
-    } // while
-
-    found->start = 1;
-    found->stop = 0;
-
-    if (F_status_is_error(status)) {
-      delimits->used = delimits_used;
-
-      return status;
-    }
-
-    if (status == F_none_eos) return F_data_not_eos;
-    if (status == F_none_stop) return F_data_not_stop;
-
-    // Seek to the end of the line when no valid object is found.
-    status = f_fss_seek_to_eol(state, buffer, range);
-
-    // Move the start position to after the EOL.
-    ++range->start;
-
-    return F_fss_found_object_not;
+    return private_fl_fss_list_object_read(f_fss_basic_list_open_s, buffer, state, range, found, delimits);
   }
 #endif // _di_fl_fss_basic_list_object_read_
 
@@ -1004,7 +744,7 @@ extern "C" {
 
     if (complete == f_fss_complete_partial_e || complete == f_fss_complete_partial_trim_e || complete == f_fss_complete_full_e || complete == f_fss_complete_full_trim_e) {
       if (complete == f_fss_complete_full_trim_e) {
-        status = private_fl_fss_basic_list_write_object_trim(destination_used, state, destination);
+        status = private_fl_fss_list_write_object_trim(destination_used, state, destination);
 
         if (F_status_is_error(status)) {
           destination->used = destination_used;
index 8ea44794b29262b2ca1b99176f8ba76706659fdf..bcf90d01338274a53564b59d308a138f2e7c92f1 100644 (file)
@@ -16,11 +16,7 @@ extern "C" {
     #endif // _di_level_1_parameter_checking_
 
     f_status_t status = f_fss_skip_past_delimit(state, buffer, range);
-    if (F_status_is_error(status)) return status;
-
-    if (status == F_none_eos || status == F_none_stop) {
-      return status;
-    }
+    if (F_status_is_error(status) || status == F_none_eos || status == F_none_stop) return status;
 
     status = f_fss_nest_increase(state.step_small, found);
     if (F_status_is_error(status)) return status;
@@ -56,22 +52,19 @@ extern "C" {
 
     f_array_length_t depth = 0;
     f_array_length_t position = 0;
-
     f_array_length_t position_previous = range->start;
     f_array_length_t line_start = range->start;
     f_array_length_t newline_last = range->start;
     f_array_length_t comment_delimit = 0;
-
     f_array_length_t slash_first = 0;
     f_array_length_t slash_last = 0;
-
     f_array_length_t before_list_open = position_previous;
 
-    bool is_open = F_false;
-
     // Designate that this is the first graph character.
     // 0x0 = false, 0x1 = true, 0x2 = false, but there is a delimited comment, comment_delimit is set.
     uint8_t graph_first = 0x1;
+    uint8_t is_open = F_false;
+    uint8_t is_object = F_false;
 
     // Initialize depth 1 start position.
     // Positions_start.used is used as a max depth (such that positions_start.used == max depth + 1).
@@ -104,6 +97,7 @@ extern "C" {
         newline_last = range->start;
         position_previous = range->start++;
         graph_first = 0x1;
+        line_start = range->start;
 
         if (depth) {
           private_macro_fl_fss_nest_return_on_overflow((buffer), (*range), (*found), (*delimits), delimits_used, (*comments), comments_used, positions_start, objects, slashes, F_end_not_nest_eos, F_end_not_nest_stop);
@@ -112,8 +106,6 @@ extern "C" {
           private_macro_fl_fss_nest_return_on_overflow_delimited((buffer), (*range), (*found), positions_start, objects, slashes, F_none_eos, F_none_stop);
         }
 
-        line_start = range->start;
-
         continue;
       }
 
@@ -121,10 +113,9 @@ extern "C" {
         slash_first = range->start;
         slash_last = range->start;
         slashes.array[depth] = 1;
-
         position_previous = range->start++;
 
-        while (range->start <= range->stop && range->start < buffer.used && (buffer.string[range->start] == f_fss_delimit_placeholder_s.string[0] || buffer.string[range->start] == f_fss_delimit_slash_s.string[0])) {
+        for (; range->start <= range->stop && range->start < buffer.used && (buffer.string[range->start] == f_fss_delimit_placeholder_s.string[0] || buffer.string[range->start] == f_fss_delimit_slash_s.string[0]); ++range->start) {
 
           if (state.interrupt) {
             status = state.interrupt((void *) &state, 0);
@@ -138,15 +129,11 @@ extern "C" {
 
           position_previous = range->start;
 
-          if (buffer.string[range->start] == f_fss_delimit_slash_s.string[0]) {
-            slash_last = range->start++;
+          if (buffer.string[position_previous] == f_fss_delimit_slash_s.string[0]) {
+            slash_last = position_previous;
             ++slashes.array[depth];
           }
-          else {
-            status = f_utf_buffer_increment(buffer, range, 1);
-            if (F_status_is_error(status)) break;
-          }
-        } // while
+        } // for
 
         if (F_status_is_error(status)) break;
 
@@ -215,9 +202,7 @@ extern "C" {
 
             if (buffer.string[range->start] != f_fss_delimit_placeholder_s.string[0]) {
               status = f_fss_is_space(state, buffer, *range);
-              if (F_status_is_error(status)) break;
-
-              if (status == F_false) break;
+              if (F_status_is_error(status) || status == F_false) break;
             }
 
             position_previous = range->start;
@@ -242,12 +227,7 @@ extern "C" {
             graph_first = 0x1;
 
             if (is_open) {
-              bool is_object = F_false;
-
-              if (slashes.array[depth] % 2 == 0) {
-                is_object = F_true;
-              }
-
+              is_object = slashes.array[depth] % 2 == 0 ? F_true : F_false;
               range->start = slash_first;
 
               status = f_array_lengths_increase_by((slashes.array[depth] / 2) + 1, delimits);
@@ -268,31 +248,39 @@ extern "C" {
                 position_previous = range->start++;
               } // while
 
-              if (F_status_is_error(status)) break;
-
               // When slashes are even, the object is valid and needs to be processed.
               if (is_object) {
-                if (++depth >= positions_start.size) {
-                  status = f_array_lengths_resize(depth + 2, &positions_start);
-                  if (F_status_is_error(status)) break;
-
+                if (++depth >= objects.size) {
                   status = f_string_ranges_resize(depth + 2, &objects);
                   if (F_status_is_error(status)) break;
+                }
 
-                  status = f_array_lengths_resize(depth + 2, &slashes);
+                if (depth >= positions_start.size) {
+                  status = f_array_lengths_resize(depth + 2, &positions_start);
                   if (F_status_is_error(status)) break;
                 }
 
-                if (positions_start.used < depth) {
-                  objects.used = depth;
-                  positions_start.used = depth;
-                  slashes.used = depth;
+                if (depth >= slashes.size) {
+                  status = f_array_lengths_resize(depth + 2, &slashes);
+                  if (F_status_is_error(status)) break;
                 }
 
                 objects.array[depth].start = line_start;
                 objects.array[depth].stop = before_list_open;
                 positions_start.array[depth] = newline_last + 1;
                 slashes.array[depth] = 0;
+
+                if (objects.used < depth) {
+                  objects.used = depth;
+                }
+
+                if (positions_start.used < depth) {
+                  positions_start.used = depth;
+                }
+
+                if (slashes.used < depth) {
+                  slashes.used = depth;
+                }
               }
             }
             else {
@@ -337,9 +325,7 @@ extern "C" {
 
           if (buffer.string[range->start] != f_fss_delimit_placeholder_s.string[0]) {
             status = f_fss_is_space(state, buffer, *range);
-            if (F_status_is_error(status)) break;
-
-            if (status == F_false) break;
+            if (F_status_is_error(status) || status == F_false) break;
           }
 
           position_previous = range->start;
@@ -358,21 +344,19 @@ extern "C" {
         }
 
         if (buffer.string[range->start] == f_fss_eol_s.string[0]) {
-          if (++depth >= positions_start.size) {
-            status = f_array_lengths_resize(depth + 2, &positions_start);
-            if (F_status_is_error(status)) break;
-
+          if (++depth >= objects.size) {
             status = f_string_ranges_resize(depth + 2, &objects);
             if (F_status_is_error(status)) break;
+          }
 
-            status = f_array_lengths_resize(depth + 2, &slashes);
+          if (depth >= positions_start.size) {
+            status = f_array_lengths_resize(depth + 2, &positions_start);
             if (F_status_is_error(status)) break;
           }
 
-          if (positions_start.used <= depth) {
-            objects.used = depth;
-            positions_start.used = depth;
-            slashes.used = depth;
+          if (depth >= slashes.size) {
+            status = f_array_lengths_resize(depth + 2, &slashes);
+            if (F_status_is_error(status)) break;
           }
 
           objects.array[depth].start = line_start;
@@ -380,6 +364,18 @@ extern "C" {
           positions_start.array[depth] = range->start + 1;
           slashes.array[depth] = 0;
 
+          if (objects.used <= depth) {
+            objects.used = depth + 1;
+          }
+
+          if (positions_start.used <= depth) {
+            positions_start.used = depth + 1;
+          }
+
+          if (slashes.used <= depth) {
+            slashes.used = depth + 1;
+          }
+
           if (graph_first == 0x2) {
             status = f_array_lengths_increase(state.step_small, delimits);
             if (F_status_is_error(status)) break;
@@ -423,6 +419,7 @@ extern "C" {
             if (buffer.string[range->start] == f_fss_eol_s.string[0]) {
               newline_last = range->start;
               line_start = range->start + 1;
+              graph_first = 0x1;
 
               break;
             }
@@ -444,8 +441,6 @@ extern "C" {
         }
       }
       else if (buffer.string[range->start] == f_fss_embedded_list_close_s.string[0]) {
-        graph_first = 0x0;
-
         while (range->start <= range->stop && range->start < buffer.used) {
 
           if (state.interrupt) {
@@ -461,15 +456,13 @@ extern "C" {
           position_previous = range->start;
 
           status = f_utf_buffer_increment(buffer, range, 1);
-          if (F_status_is_error(status)) break;
 
+          if (F_status_is_error(status)) break;
           if (buffer.string[range->start] == f_fss_eol_s.string[0]) break;
 
           if (buffer.string[range->start] != f_fss_delimit_placeholder_s.string[0]) {
             status = f_fss_is_space(state, buffer, *range);
-            if (F_status_is_error(status)) break;
-
-            if (status == F_false) break;
+            if (F_status_is_error(status) || status == F_false) break;
           }
         } // while
 
@@ -483,10 +476,12 @@ extern "C" {
         }
 
         if (buffer.string[range->start] == f_fss_eol_s.string[0]) {
-          status = f_fss_nest_increase(state.step_small, found);
-          if (F_status_is_error(status)) break;
+          if (depth >= found->used) {
+            status = f_fss_nest_resize(depth + 2, found);
+            if (F_status_is_error(status)) break;
+          }
 
-          if (found->depth[depth].used == found->depth[depth].size) {
+          if (found->depth[depth].used >= found->depth[depth].size) {
             status = f_fss_items_increase(state.step_small, &found->depth[depth]);
             if (F_status_is_error(status)) break;
           }
@@ -599,26 +594,33 @@ extern "C" {
         }
       }
       else if (graph_first == 0x1 && buffer.string[range->start] == f_fss_comment_s.string[0]) {
-        position = line_start;
 
-        status = f_fss_seek_to_eol(state, buffer, range);
-        if (F_status_is_error(status)) break;
+        // The newline_last is initialized to the range->start, which may not actually be a new line.
+        position = (buffer.string[newline_last] == f_string_eol_s.string[0]) ? newline_last + 1 : newline_last;
 
-        status = f_string_ranges_increase(state.step_small, comments);
+        status = f_fss_seek_to_eol(state, buffer, range);
         if (F_status_is_error(status)) break;
 
         if (range->start > range->stop || range->start >= buffer.used) {
           --range->start;
         }
         else {
+          if (graph_first == 0x2) {
+            status = f_array_lengths_increase(state.step_small, delimits);
+            if (F_status_is_error(status)) break;
+
+            delimits->array[delimits->used++] = comment_delimit;
+          }
+
           newline_last = range->start;
+          graph_first = 0x1;
         }
 
-        graph_first = 0x1;
+        status = f_string_ranges_increase(state.step_small, comments);
+        if (F_status_is_error(status)) break;
 
         comments->array[comments->used].start = position;
         comments->array[comments->used++].stop = range->start++;
-        line_start = range->start;
 
         continue;
       }
@@ -658,14 +660,10 @@ extern "C" {
     if (F_status_is_error(status)) return status;
 
     if (range->start > range->stop) {
-      if (!depth) return F_status_set_error(F_end_not_stop);
-
-      return F_status_set_error(F_end_not_nest_stop);
+      return depth ? F_status_set_error(F_end_not_nest_stop) : F_status_set_error(F_end_not_stop);
     }
 
-    if (!depth) return F_status_set_error(F_end_not_eos);
-
-    return F_status_set_error(F_end_not_nest_eos);
+    return depth ? F_status_set_error(F_end_not_nest_eos) : F_status_set_error(F_end_not_eos);
   }
 #endif // _di_fl_fss_embedded_list_content_read_
 
@@ -790,7 +788,7 @@ extern "C" {
 
             range->start = start + 1;
 
-            status = private_fl_fss_basic_list_write_add_until_end(content, state, range, destination);
+            status = private_fl_fss_list_write_add_until_end(content, state, range, destination);
             if (F_status_is_error(status)) break;
 
             if (content.string[range->start] != f_fss_eol_s.string[0]) {
@@ -870,7 +868,7 @@ extern "C" {
 
           range->start = start + 1;
 
-          status = private_fl_fss_basic_list_write_add_until_end(content, state, range, destination);
+          status = private_fl_fss_list_write_add_until_end(content, state, range, destination);
           if (F_status_is_error(status)) break;
 
           continue;
@@ -961,293 +959,7 @@ extern "C" {
       if (!delimits) return F_status_set_error(F_parameter);
     #endif // _di_level_1_parameter_checking_
 
-    const f_array_length_t delimits_used = delimits->used;
-
-    f_status_t status = f_fss_skip_past_space(state, buffer, range);
-    if (F_status_is_error(status)) return status;
-
-    if (status == F_none_eol) {
-
-      // Move the start position to after the EOL.
-      ++range->start;
-
-      return F_fss_found_object_not;
-    }
-
-    if (status == F_none_eos) return F_data_not_eos;
-    if (status == F_none_stop) return F_data_not_stop;
-
-    // Return found nothing if this line only contains white space and delimit placeholders.
-    if (buffer.string[range->start] == f_fss_eol_s.string[0]) {
-
-      // Move the start position to after the EOL.
-      ++range->start;
-
-      return F_fss_found_object_not;
-    }
-
-    // Begin the search.
-    const f_number_unsigned_t begin = range->start;
-    found->start = range->start;
-
-    // Ignore all comment lines.
-    if (buffer.string[range->start] == f_fss_comment_s.string[0]) {
-      status = f_fss_seek_to_eol(state, buffer, range);
-
-      if (F_status_is_error(status)) {
-        delimits->used = delimits_used;
-
-        return status;
-      }
-
-      if (status == F_none_eos) return F_data_not_eos;
-      if (status == F_none_stop) return F_data_not_stop;
-
-      // Move the start position to after the EOL.
-      ++range->start;
-
-      return F_fss_found_object_not;
-    }
-
-    f_array_length_t start = 0;
-    f_array_length_t stop = 0;
-    f_array_length_t slash_first = 0;
-    f_array_length_t slash_count = 0;
-
-    bool graph_first = F_true;
-
-    // Identify where the object ends.
-    while (range->start <= range->stop && range->start < buffer.used && buffer.string[range->start] != f_fss_eol_s.string[0]) {
-
-      if (state.interrupt) {
-        status = state.interrupt((void *) &state, 0);
-
-        if (F_status_set_fine(status) == F_interrupt) {
-          status = F_status_set_error(F_interrupt);
-
-          break;
-        }
-      }
-
-      if (buffer.string[range->start] == f_fss_delimit_slash_s.string[0]) {
-        slash_first = range->start;
-        slash_count = 1;
-
-        status = f_utf_buffer_increment(buffer, range, 1);
-        if (F_status_is_error(status)) break;
-
-        while (range->start <= range->stop && range->start < buffer.used && (buffer.string[range->start] == f_fss_delimit_placeholder_s.string[0] || buffer.string[range->start] == f_fss_delimit_slash_s.string[0])) {
-
-          if (state.interrupt) {
-            status = state.interrupt((void *) &state, 0);
-
-            if (F_status_set_fine(status) == F_interrupt) {
-              status = F_status_set_error(F_interrupt);
-
-              break;
-            }
-          }
-
-          if (buffer.string[range->start] == f_fss_delimit_slash_s.string[0]) slash_count++;
-
-          status = f_utf_buffer_increment(buffer, range, 1);
-          if (F_status_is_error(status)) break;
-        } // while
-
-        if (F_status_is_error(status)) break;
-
-        private_macro_fl_fss_object_return_on_overflow((buffer), (*range), (*found), (*delimits), delimits_used, F_data_not_eos, F_data_not_stop);
-
-        if (buffer.string[range->start] == f_fss_embedded_list_open_s.string[0]) {
-          graph_first = F_false;
-          stop = range->start++;
-
-          while (range->start <= range->stop && range->start < buffer.used) {
-
-            if (state.interrupt) {
-              status = state.interrupt((void *) &state, 0);
-
-              if (F_status_set_fine(status) == F_interrupt) {
-                status = F_status_set_error(F_interrupt);
-
-                break;
-              }
-            }
-
-            if (buffer.string[range->start] == f_fss_eol_s.string[0]) break;
-
-            status = f_fss_is_graph(state, buffer, *range);
-            if (F_status_is_error(status)) break;
-
-            if (status == F_true) break;
-
-            status = f_utf_buffer_increment(buffer, range, 1);
-            if (F_status_is_error(status)) break;
-          } // while
-
-          private_macro_fl_fss_object_return_on_overflow((buffer), (*range), (*found), (*delimits), delimits_used, F_data_not_eos, F_data_not_stop);
-
-          if (buffer.string[range->start] == f_fss_eol_s.string[0]) {
-            start = range->start;
-
-            range->start = slash_first;
-
-            status = f_array_lengths_increase_by((slash_count / 2) + 1, delimits);
-            if (F_status_is_error(status)) break;
-
-            if (slash_count % 2 == 0) {
-              while (slash_count > 0) {
-
-                if (buffer.string[range->start] == f_fss_delimit_slash_s.string[0]) {
-                  if (slash_count % 2 == 1) {
-                    delimits->array[delimits->used++] = range->start;
-                  }
-
-                  --slash_count;
-                }
-
-                status = f_utf_buffer_increment(buffer, range, 1);
-                if (F_status_is_error(status)) break;
-              } // while
-
-              if (F_status_is_error(status)) break;
-
-              if (stop > begin) {
-                found->stop = stop - 1;
-              }
-              else {
-                found->start = 1;
-                found->stop = 0;
-              }
-
-              range->start = start + 1;
-
-              return F_fss_found_object;
-            }
-
-            range->start = start + 1;
-            return F_fss_found_object_not;
-          }
-        }
-        else if (graph_first && buffer.string[range->start] == f_fss_comment_s.string[0]) {
-          graph_first = F_false;
-
-          // Comments may only have white space before the '#', therefore only the first slash needs to be delimited.
-          status = f_array_lengths_increase(state.step_small, delimits);
-          if (F_status_is_error(status)) break;
-
-          delimits->array[delimits->used++] = slash_first;
-          ++range->start;
-        }
-        else {
-          graph_first = F_false;
-        }
-
-        continue;
-      }
-      else if (buffer.string[range->start] == f_fss_embedded_list_open_s.string[0]) {
-        graph_first = F_false;
-        stop = range->start;
-
-        status = f_utf_buffer_increment(buffer, range, 1);
-        if (F_status_is_error(status)) break;
-
-        while (range->start <= range->stop && range->start < buffer.used) {
-
-          if (state.interrupt) {
-            status = state.interrupt((void *) &state, 0);
-
-            if (F_status_set_fine(status) == F_interrupt) {
-              status = F_status_set_error(F_interrupt);
-
-              break;
-            }
-          }
-
-          if (buffer.string[range->start] == f_fss_eol_s.string[0]) break;
-
-          status = f_fss_is_space(state, buffer, *range);
-          if (F_status_is_error(status)) break;
-
-          if (status == F_false) break;
-
-          status = f_utf_buffer_increment(buffer, range, 1);
-          if (F_status_is_error(status)) break;
-        } // while
-
-        if (F_status_is_error(status)) break;
-
-        private_macro_fl_fss_object_return_on_overflow_delimited((buffer), (*range), (*found), F_none_eos, F_none_stop);
-
-        if (buffer.string[range->start] == f_fss_eol_s.string[0]) {
-          if (stop > begin) {
-            found->stop = stop - 1;
-          }
-          else {
-            found->start = 1;
-            found->stop = 0;
-          }
-
-          // Move the start position to after the EOL.
-          ++range->start;
-
-          return F_fss_found_object;
-        }
-
-        continue;
-      }
-      else if (graph_first) {
-        status = f_fss_is_space(state, buffer, *range);
-        if (F_status_is_error(status)) break;
-
-        if (status == F_false) {
-          graph_first = F_false;
-        }
-      }
-
-      status = f_utf_buffer_increment(buffer, range, 1);
-      if (F_status_is_error(status)) break;
-    } // while
-
-    if (F_status_is_error(status)) {
-      delimits->used = delimits_used;
-
-      return status;
-    }
-
-    // Seek to the end of the line when no valid object is found.
-    while (range->start <= range->stop && range->start < buffer.used && buffer.string[range->start] != f_fss_eol_s.string[0]) {
-
-      if (state.interrupt) {
-        status = state.interrupt((void *) &state, 0);
-
-        if (F_status_set_fine(status) == F_interrupt) {
-          status = F_status_set_error(F_interrupt);
-
-          break;
-        }
-      }
-
-      status = f_utf_buffer_increment(buffer, range, 1);
-
-      if (F_status_is_error(status)) {
-        delimits->used = delimits_used;
-
-        return status;
-      }
-    } // while
-
-    private_macro_fl_fss_object_return_on_overflow((buffer), (*range), (*found), (*delimits), delimits_used, F_data_not_eos, F_data_not_stop);
-
-    status = f_utf_buffer_increment(buffer, range, 1);
-
-    if (F_status_is_error(status)) {
-      delimits->used = delimits_used;
-
-      return status;
-    }
-
-    return F_fss_found_object_not;
+    return private_fl_fss_list_object_read(f_fss_embedded_list_open_s, buffer, state, range, found, delimits);
   }
 #endif // _di_fl_fss_embedded_list_object_read_
 
@@ -1460,7 +1172,7 @@ extern "C" {
 
     if (complete == f_fss_complete_partial_e || complete == f_fss_complete_partial_trim_e || complete == f_fss_complete_full_e || complete == f_fss_complete_full_trim_e) {
       if (complete == f_fss_complete_full_trim_e) {
-        status = private_fl_fss_basic_list_write_object_trim(destination_used, state, destination);
+        status = private_fl_fss_list_write_object_trim(destination_used, state, destination);
 
         if (F_status_is_error(status)) {
           destination->used = destination_used;
index f12da3c0e521f6c90baef63cc1fd467bf4517c9a..fe5af4b0f3e1d5cce841da63cab476c1fa19fece 100644 (file)
@@ -34,10 +34,12 @@ extern "C" {
 
     uint8_t content_found = 0;
     f_fss_quote_t quote = f_fss_quote_type_none_e;
+    f_string_range_t content_partial = f_string_range_t_initialize;
 
     while (range->start <= range->stop && range->start < buffer.used) {
 
-      f_string_range_t content_partial = f_string_range_t_initialize;
+      content_partial.start = 1;
+      content_partial.stop = 0;
 
       status = private_fl_fss_basic_or_extended_read(buffer, (state.flag & f_fss_state_quote_not_e) ? 0x2 : 0x0, state, range, &content_partial, &quote, delimits);
 
index 2823d30a3726fc6bca248144039e6572696a65f6..a2457cb5db5192ea98eff3f35e8dfb8e92a22b94 100644 (file)
@@ -15,24 +15,24 @@ extern "C" {
       if (!comments) return F_status_set_error(F_parameter);
     #endif // _di_level_1_parameter_checking_
 
-    const f_array_length_t delimits_used = delimits->used;
-    const f_array_length_t comments_used = comments->used;
-
     f_status_t status = f_fss_skip_past_delimit(state, buffer, range);
     if (F_status_is_error(status)) return status;
 
+    const f_array_length_t delimits_used = delimits->used;
+    const f_array_length_t comments_used = comments->used;
+
     private_macro_fl_fss_content_with_comments_return_on_overflow((buffer), (*range), (*found), (*delimits), delimits_used, (*comments), comments_used, F_none_eos, F_none_stop);
 
     status = f_string_ranges_increase(state.step_small, found);
     if (F_status_is_error(status)) return status;
 
-    found->array[found->used].start = range->start;
-
     f_array_length_t newline_last = range->start;
     f_array_length_t slash_first = 0;
     f_array_length_t slash_count = 0;
     f_array_length_t comment_start = 0;
 
+    found->array[found->used].start = range->start;
+
     // Identify where the content ends.
     while (range->start <= range->stop && range->start < buffer.used) {
 
@@ -216,11 +216,12 @@ extern "C" {
     if (F_status_is_error(status)) {
       delimits->used = delimits_used;
       comments->used = comments_used;
-
-      return status;
+    }
+    else {
+      status = F_fss_found_content_not;
     }
 
-    return F_fss_found_content_not;
+    return status;
   }
 #endif // _di_fl_fss_extended_list_content_read_
 
@@ -349,7 +350,7 @@ extern "C" {
 
             range->start = start + 1;
 
-            status = private_fl_fss_basic_list_write_add_until_end(content, state, range, destination);
+            status = private_fl_fss_list_write_add_until_end(content, state, range, destination);
             if (F_status_is_error(status)) break;
 
             if (content.string[range->start] != f_fss_eol_s.string[0]) {
@@ -429,7 +430,7 @@ extern "C" {
 
           range->start = start + 1;
 
-          status = private_fl_fss_basic_list_write_add_until_end(content, state, range, destination);
+          status = private_fl_fss_list_write_add_until_end(content, state, range, destination);
           if (F_status_is_error(status)) break;
 
           continue;
@@ -524,294 +525,7 @@ extern "C" {
       if (!delimits) return F_status_set_error(F_parameter);
     #endif // _di_level_1_parameter_checking_
 
-    const f_array_length_t delimits_used = delimits->used;
-
-    f_status_t status = f_fss_skip_past_space(state, buffer, range);
-    if (F_status_is_error(status)) return status;
-
-    if (status == F_none_eol) {
-
-      // Move the start position to after the EOL.
-      ++range->start;
-
-      return F_fss_found_object_not;
-    }
-
-    if (status == F_none_eos) return F_data_not_eos;
-    if (status == F_none_stop) return F_data_not_stop;
-
-    // Return found nothing if this line only contains white space and delimit placeholders.
-    if (buffer.string[range->start] == f_fss_eol_s.string[0]) {
-
-      // Move the start position to after the EOL.
-      ++range->start;
-
-      return F_fss_found_object_not;
-    }
-
-    // Begin the search.
-    const f_number_unsigned_t begin = range->start;
-    found->start = range->start;
-
-    // Ignore all comment lines.
-    if (buffer.string[range->start] == f_fss_comment_s.string[0]) {
-      status = f_fss_seek_to_eol(state, buffer, range);
-
-      if (F_status_is_error(status)) {
-        delimits->used = delimits_used;
-
-        return status;
-      }
-
-      if (status == F_none_eos) return F_data_not_eos;
-      if (status == F_none_stop) return F_data_not_stop;
-
-      // Move the start position to after the EOL.
-      ++range->start;
-
-      return F_fss_found_object_not;
-    }
-
-    f_array_length_t start = 0;
-    f_array_length_t stop = 0;
-    f_array_length_t slash_first = 0;
-    f_array_length_t slash_count = 0;
-
-    // Designate that this is the first graph character.
-    uint8_t graph_first = F_true;
-
-    // Identify where the object ends.
-    while (range->start <= range->stop && range->start < buffer.used && buffer.string[range->start] != f_fss_eol_s.string[0]) {
-
-      if (state.interrupt) {
-        status = state.interrupt((void *) &state, 0);
-
-        if (F_status_set_fine(status) == F_interrupt) {
-          status = F_status_set_error(F_interrupt);
-
-          break;
-        }
-      }
-
-      if (buffer.string[range->start] == f_fss_delimit_slash_s.string[0]) {
-        slash_first = range->start;
-        slash_count = 1;
-
-        status = f_utf_buffer_increment(buffer, range, 1);
-        if (F_status_is_error(status)) break;
-
-        while (range->start <= range->stop && range->start < buffer.used && (buffer.string[range->start] == f_fss_delimit_placeholder_s.string[0] || buffer.string[range->start] == f_fss_delimit_slash_s.string[0])) {
-
-          if (state.interrupt) {
-            status = state.interrupt((void *) &state, 0);
-
-            if (F_status_set_fine(status) == F_interrupt) {
-              status = F_status_set_error(F_interrupt);
-
-              break;
-            }
-          }
-
-          if (buffer.string[range->start] == f_fss_delimit_slash_s.string[0]) ++slash_count;
-
-          status = f_utf_buffer_increment(buffer, range, 1);
-          if (F_status_is_error(status)) break;
-        } // while
-
-        if (F_status_is_error(status)) break;
-
-        private_macro_fl_fss_object_return_on_overflow((buffer), (*range), (*found), (*delimits), delimits_used, F_data_not_eos, F_data_not_stop);
-
-        if (buffer.string[range->start] == f_fss_extended_list_open_s.string[0]) {
-          graph_first = F_false;
-          stop = range->start++;
-
-          while (range->start <= range->stop && range->start < buffer.used) {
-
-            if (state.interrupt) {
-              status = state.interrupt((void *) &state, 0);
-
-              if (F_status_set_fine(status) == F_interrupt) {
-                status = F_status_set_error(F_interrupt);
-
-                break;
-              }
-            }
-
-            if (buffer.string[range->start] == f_fss_eol_s.string[0]) break;
-
-            status = f_fss_is_graph(state, buffer, *range);
-            if (F_status_is_error(status)) break;
-
-            if (status == F_true) break;
-
-            status = f_utf_buffer_increment(buffer, range, 1);
-            if (F_status_is_error(status)) break;
-          } // while
-
-          private_macro_fl_fss_object_return_on_overflow((buffer), (*range), (*found), (*delimits), delimits_used, F_data_not_eos, F_data_not_stop);
-
-          if (buffer.string[range->start] == f_fss_eol_s.string[0]) {
-            start = range->start;
-            range->start = slash_first;
-
-            status = f_array_lengths_increase_by((slash_count / 2) + 1, delimits);
-            if (F_status_is_error(status)) break;
-
-            if (slash_count % 2 == 0) {
-              while (slash_count > 0) {
-
-                if (buffer.string[range->start] == f_fss_delimit_slash_s.string[0]) {
-                  if (slash_count % 2 == 1) {
-                    delimits->array[delimits->used++] = range->start;
-                  }
-
-                  --slash_count;
-                }
-
-                status = f_utf_buffer_increment(buffer, range, 1);
-                if (F_status_is_error(status)) break;
-              } // while
-
-              if (F_status_is_error(status)) break;
-
-              if (stop > begin) {
-                found->stop = stop - 1;
-              }
-              else {
-                found->start = 1;
-                found->stop = 0;
-              }
-
-              range->start = start + 1;
-
-              return F_fss_found_object;
-            }
-
-            range->start = start + 1;
-
-            return F_fss_found_object_not;
-          }
-        }
-        else if (graph_first && buffer.string[range->start] == f_fss_comment_s.string[0]) {
-          graph_first = F_false;
-
-          // Comments may only have white space before the '#', therefore only the first slash needs to be delimited.
-          status = f_array_lengths_increase(state.step_small, delimits);
-          if (F_status_is_error(status)) break;
-
-          delimits->array[delimits->used++] = slash_first;
-          ++range->start;
-        }
-        else {
-          graph_first = F_false;
-        }
-
-        continue;
-      }
-      else if (buffer.string[range->start] == f_fss_extended_list_open_s.string[0]) {
-        graph_first = F_false;
-        stop = range->start;
-
-        status = f_utf_buffer_increment(buffer, range, 1);
-        if (F_status_is_error(status)) break;
-
-        while (range->start <= range->stop && range->start < buffer.used) {
-
-          if (state.interrupt) {
-            status = state.interrupt((void *) &state, 0);
-
-            if (F_status_set_fine(status) == F_interrupt) {
-              status = F_status_set_error(F_interrupt);
-
-              break;
-            }
-          }
-
-          if (buffer.string[range->start] == f_fss_eol_s.string[0]) break;
-
-          status = f_fss_is_space(state, buffer, *range);
-          if (F_status_is_error(status)) break;
-
-          if (status == F_false) break;
-
-          status = f_utf_buffer_increment(buffer, range, 1);
-          if (F_status_is_error(status)) break;
-        } // while
-
-        if (F_status_is_error(status)) break;
-
-        private_macro_fl_fss_object_return_on_overflow_delimited((buffer), (*range), (*found), F_none_eos, F_none_stop);
-
-        if (buffer.string[range->start] == f_fss_eol_s.string[0]) {
-          if (stop > begin) {
-            found->stop = stop - 1;
-          }
-          else {
-            found->start = 1;
-            found->stop = 0;
-          }
-
-          // Move the start position to after the EOL.
-          ++range->start;
-
-          return F_fss_found_object;
-        }
-
-        continue;
-      }
-      else if (graph_first) {
-        status = f_fss_is_space(state, buffer, *range);
-        if (F_status_is_error(status)) break;
-
-        if (status == F_false) {
-          graph_first = F_false;
-        }
-      }
-
-      status = f_utf_buffer_increment(buffer, range, 1);
-      if (F_status_is_error(status)) break;
-    } // while
-
-    if (F_status_is_error(status)) {
-      delimits->used = delimits_used;
-
-      return status;
-    }
-
-    // Seek to the end of the line when no valid object is found.
-    while (range->start <= range->stop && range->start < buffer.used && buffer.string[range->start] != f_fss_eol_s.string[0]) {
-
-      if (state.interrupt) {
-        status = state.interrupt((void *) &state, 0);
-
-        if (F_status_set_fine(status) == F_interrupt) {
-          status = F_status_set_error(F_interrupt);
-
-          break;
-        }
-      }
-
-      status = f_utf_buffer_increment(buffer, range, 1);
-
-      if (F_status_is_error(status)) {
-        delimits->used = delimits_used;
-
-        return status;
-      }
-    } // while
-
-    private_macro_fl_fss_object_return_on_overflow((buffer), (*range), (*found), (*delimits), delimits_used, F_data_not_eos, F_data_not_stop);
-
-    status = f_utf_buffer_increment(buffer, range, 1);
-
-    if (F_status_is_error(status)) {
-      delimits->used = delimits_used;
-
-      return status;
-    }
-
-    return F_fss_found_object_not;
+    return private_fl_fss_list_object_read(f_fss_extended_list_open_s, buffer, state, range, found, delimits);
   }
 #endif // _di_fl_fss_extended_list_object_read_
 
@@ -1024,7 +738,7 @@ extern "C" {
 
     if (complete == f_fss_complete_partial_e || complete == f_fss_complete_partial_trim_e || complete == f_fss_complete_full_e || complete == f_fss_complete_full_trim_e) {
       if (complete == f_fss_complete_full_trim_e) {
-        status = private_fl_fss_basic_list_write_object_trim(destination_used, state, destination);
+        status = private_fl_fss_list_write_object_trim(destination_used, state, destination);
 
         if (F_status_is_error(status)) {
           destination->used = destination_used;
index f5460c018812d2207138a65f5ce0569b09932875..8221907fc1b8c151e13f4c5c87d2d43c2871cb25 100644 (file)
@@ -17,15 +17,13 @@ extern "C" {
 #ifndef _di_private_macro_fl_fss_object_return_on_overflow_
   #define private_macro_fl_fss_object_return_on_overflow(buffer, range, found, delimits, delimits_used, eos_status, stop_status) \
     if (range.start >= buffer.used) { \
+      found.stop = buffer.used - 1; \
       delimits.used = delimits_used; \
-      found.start = 1; \
-      found.stop = 0; \
       return eos_status; \
     } \
     else if (range.start > range.stop) { \
+      found.stop = range.stop; \
       delimits.used = delimits_used; \
-      found.start = 1; \
-      found.stop = 0; \
       return stop_status; \
     }
 #endif // _di_private_macro_fl_fss_object_return_on_overflow_
@@ -33,13 +31,11 @@ extern "C" {
 #ifndef _di_private_macro_fl_fss_object_return_on_overflow_delimited_
   #define private_macro_fl_fss_object_return_on_overflow_delimited(buffer, range, found, eos_status, stop_status) \
     if (range.start >= buffer.used) { \
-      found.start = 1; \
-      found.stop = 0; \
+      found.stop = buffer.used - 1; \
       return eos_status; \
     } \
     else if (range.start > range.stop) { \
-      found.start = 1; \
-      found.stop = 0; \
+      found.stop = range.stop; \
       return stop_status; \
     }
 #endif // _di_private_macro_fl_fss_object_return_on_overflow_delimited_
index afff42fc4fd7cb5408f988d877834fad4ffa444f..025d6b81204d6b2ef375b36536163b4f4ba186cd 100644 (file)
@@ -6,8 +6,313 @@
 extern "C" {
 #endif
 
+#if !defined(_di_fl_fss_basic_list_object_read_) || !defined(_di_fl_fss_embedded_list_object_read_) || !defined(_di_fl_fss_extended_list_object_read_)
+  f_status_t private_fl_fss_list_object_read(const f_string_static_t list_open, const f_string_static_t buffer, f_state_t state, f_string_range_t * const range, f_fss_object_t * const found, f_fss_delimits_t * const delimits) {
+
+    f_status_t status = f_fss_skip_past_space(state, buffer, range);
+    if (F_status_is_error(status)) return status;
+
+    if (status == F_none_eol) {
+
+      // Move the start position to after the EOL.
+      ++range->start;
+
+      return F_fss_found_object_not;
+    }
+
+    if (status == F_none_eos) return F_data_not_eos;
+    if (status == F_none_stop) return F_data_not_stop;
+
+    // Return found nothing if this line only contains white space and delimit placeholders.
+    if (buffer.string[range->start] == f_fss_eol_s.string[0]) {
+
+      // Move the start position to after the EOL.
+      ++range->start;
+
+      return F_fss_found_object_not;
+    }
+
+    // Ignore all comment lines.
+    if (buffer.string[range->start] == f_fss_comment_s.string[0]) {
+      status = f_fss_seek_to_eol(state, buffer, range);
+
+      if (F_status_is_error(status)) return status;
+      if (status == F_none_eos) return F_data_not_eos;
+      if (status == F_none_stop) return F_data_not_stop;
+
+      // Move the start position to after the EOL.
+      ++range->start;
+
+      return F_fss_found_object_not;
+    }
+
+    const f_array_length_t delimits_used = delimits->used;
+
+    f_array_length_t slash_first = 0;
+    f_array_length_t slash_count = 0;
+    f_array_length_t start = 1;
+    f_array_length_t stop = 0;
+
+    uint8_t graph_first = F_true;
+
+    found->start = range->start;
+
+    // Identify where the object ends.
+    while (range->start <= range->stop && range->start < buffer.used && buffer.string[range->start] != f_fss_eol_s.string[0]) {
+
+      if (state.interrupt) {
+        status = state.interrupt((void *) &state, 0);
+
+        if (F_status_set_fine(status) == F_interrupt) {
+          delimits->used = delimits_used;
+
+          return F_status_set_error(F_interrupt);
+        }
+      }
+
+      if (buffer.string[range->start] == f_fss_delimit_slash_s.string[0]) {
+        slash_first = range->start++;
+        slash_count = 1;
+
+        for (; range->start <= range->stop && range->start < buffer.used && (buffer.string[range->start] == f_fss_delimit_placeholder_s.string[0] || buffer.string[range->start] == f_fss_delimit_slash_s.string[0]); ++range->start) {
+
+          if (state.interrupt) {
+            status = state.interrupt((void *) &state, 0);
+
+            if (F_status_set_fine(status) == F_interrupt) {
+              delimits->used = delimits_used;
+
+              return F_status_set_error(F_interrupt);
+            }
+          }
+
+          if (buffer.string[range->start] == f_fss_delimit_slash_s.string[0]) slash_count++;
+        } // for
+
+        private_macro_fl_fss_object_return_on_overflow((buffer), (*range), (*found), (*delimits), delimits_used, F_data_not_eos, F_data_not_stop);
+
+        if (buffer.string[range->start] == list_open.string[0]) {
+          graph_first = F_false;
+          stop = range->start++;
+
+          while (range->start <= range->stop && range->start < buffer.used) {
+
+            if (state.interrupt) {
+              status = state.interrupt((void *) &state, 0);
+
+              if (F_status_set_fine(status) == F_interrupt) {
+                delimits->used = delimits_used;
+
+                return F_status_set_error(F_interrupt);
+              }
+            }
+
+            if (buffer.string[range->start] == f_fss_eol_s.string[0]) break;
+
+            status = f_fss_is_space(state, buffer, *range);
+            if (status == F_false) break;
+
+            if (F_status_is_error_not(status)) {
+              status = f_utf_buffer_increment(buffer, range, 1);
+            }
+
+            if (F_status_is_error(status)) {
+              delimits->used = delimits_used;
+
+              return status;
+            }
+          } // while
+
+          private_macro_fl_fss_object_return_on_overflow((buffer), (*range), (*found), (*delimits), delimits_used, F_data_not_eos, F_data_not_stop);
+
+          if (buffer.string[range->start] == f_fss_eol_s.string[0]) {
+            found->stop = range->start;
+            range->start = slash_first;
+
+            status = f_array_lengths_increase_by((slash_count / 2) + 1, delimits);
+
+            if (F_status_is_error(status)) {
+              range->start = found->stop;
+              delimits->used = delimits_used;
+
+              return status;
+            }
+
+            if (slash_count % 2 == 0) {
+              while (slash_count > 0) {
+
+                if (buffer.string[range->start] == f_fss_delimit_slash_s.string[0]) {
+                  if (slash_count % 2 == 1) {
+                    delimits->array[delimits->used++] = range->start;
+                  }
+
+                  --slash_count;
+                  ++range->start;
+                }
+                else {
+                  status = f_utf_buffer_increment(buffer, range, 1);
+
+                  if (F_status_is_error(status)) {
+                    range->start = found->stop;
+                    delimits->used = delimits_used;
+
+                    return status;
+                  }
+                }
+              } // while
+
+              range->start = found->stop + 1;
+              found->start = start;
+              found->stop = stop + macro_f_utf_byte_width(buffer.string[stop]) - 1;
+              status = F_fss_found_object;
+            }
+            else {
+              range->start = found->stop + 1;
+              status = F_fss_found_object_not;
+            }
+
+            return status;
+          }
+        }
+        else if (graph_first && buffer.string[range->start] == f_fss_comment_s.string[0]) {
+          if (graph_first) {
+            graph_first = F_false;
+            start = slash_first;
+          }
+
+          // Comments may only have white space before the '#', therefore only the first slash needs to be delimited.
+          status = f_array_lengths_increase(state.step_small, delimits);
+
+          if (F_status_is_error(status)) {
+            delimits->used = delimits_used;
+
+            return status;
+          }
+
+          delimits->array[delimits->used++] = slash_first;
+          stop = range->start++;
+        }
+        else {
+          graph_first = F_false;
+          stop = range->start;
+        }
+
+        continue;
+      }
+      else if (buffer.string[range->start] == list_open.string[0]) {
+        ++range->start;
+
+        while (range->start <= range->stop && range->start < buffer.used) {
+
+          if (state.interrupt) {
+            status = state.interrupt((void *) &state, 0);
+
+            if (F_status_set_fine(status) == F_interrupt) {
+              delimits->used = delimits_used;
+
+              return F_status_set_error(F_interrupt);
+            }
+          }
+
+          if (buffer.string[range->start] == f_fss_eol_s.string[0]) break;
+
+          status = f_fss_is_space(state, buffer, *range);
+          if (status == F_false) break;
+
+          if (F_status_is_error_not(status)) {
+            status = f_utf_buffer_increment(buffer, range, 1);
+          }
+
+          if (F_status_is_error(status)) {
+            delimits->used = delimits_used;
+
+            return status;
+          }
+        } // while
+
+        private_macro_fl_fss_object_return_on_overflow_delimited((buffer), (*range), (*found), F_none_eos, F_none_stop);
+
+        if (buffer.string[range->start] == f_fss_eol_s.string[0]) {
+          found->start = start;
+          found->stop = stop + macro_f_utf_byte_width(buffer.string[stop]) - 1;
+          ++range->start;
+
+          return F_fss_found_object;
+        }
+
+        if (graph_first) {
+          graph_first = F_false;
+          start = 1;
+          stop = 0;
+        }
+        else {
+          stop = range->start;
+        }
+
+        continue;
+      }
+      else {
+        status = f_fss_is_space(state, buffer, *range);
+
+        if (F_status_is_error(status)) {
+          delimits->used = delimits_used;
+
+          return status;
+        }
+
+        if (status == F_false) {
+          if (graph_first) {
+            graph_first = F_false;
+            start = range->start;
+          }
+
+          stop = range->start;
+        }
+      }
+
+      status = f_utf_buffer_increment(buffer, range, 1);
+
+      if (F_status_is_error(status)) {
+        delimits->used = delimits_used;
+
+        return status;
+      }
+    } // while
+
+    if (range->start >= buffer.used || range->start > range->stop) {
+      if (range->start >= buffer.used) {
+        found->stop = buffer.used - 1;
+        status = F_data_not_eos;
+      }
+      else {
+        found->stop = range->stop;
+        status = F_data_not_stop;
+      }
+
+      return status;
+    }
+
+    // Seek to the end of the line when no valid object is found.
+    if (F_status_is_error_not(status)) {
+      status = f_fss_seek_to_eol(state, buffer, range);
+    }
+
+    if (F_status_is_error(status)) {
+      delimits->used = delimits_used;
+    }
+    else {
+      status = F_fss_found_object_not;
+
+      // Move the start position to after the EOL.
+      ++range->start;
+    }
+
+    return status;
+  }
+#endif // !defined(_di_fl_fss_basic_list_object_read_) || !defined(_di_fl_fss_embedded_list_object_read_) || !defined(_di_fl_fss_extended_list_object_read_)
+
 #if !defined(_di_fl_fss_basic_list_content_write_) || !defined(_di_fl_fss_extended_list_content_write_) || !defined(_di_fl_fss_embedded_list_content_write_)
-  f_status_t private_fl_fss_basic_list_write_add_until_end(const f_string_static_t buffer, f_state_t state, f_string_range_t * const range, f_string_dynamic_t * const destination) {
+  f_status_t private_fl_fss_list_write_add_until_end(const f_string_static_t buffer, f_state_t state, f_string_range_t * const range, f_string_dynamic_t * const destination) {
 
     f_status_t status = F_none;
 
@@ -35,7 +340,7 @@ extern "C" {
 #endif // !defined(_di_fl_fss_basic_list_content_write_) || !defined(_di_fl_fss_extended_list_content_write_) || !defined(_di_fl_fss_embedded_list_content_write_)
 
 #if !defined(_di_fl_fss_basic_list_object_write_) || !defined(_di_fl_fss_extended_list_object_write_)
-  f_status_t private_fl_fss_basic_list_write_object_trim(const f_array_length_t used_start, f_state_t state, f_string_dynamic_t * const destination) {
+  f_status_t private_fl_fss_list_write_object_trim(const f_array_length_t used_start, f_state_t state, f_string_dynamic_t * const destination) {
 
     f_status_t status = F_none;
     f_string_range_t destination_range = macro_f_string_range_t_initialize2(destination->used);
@@ -149,27 +454,10 @@ extern "C" {
 
     // Ignore all comment lines.
     if ((flag & 0x1) && buffer.string[range->start] == f_fss_comment_s.string[0]) {
-
-      while (buffer.string[range->start] != f_fss_eol_s.string[0]) {
-
-        if (state.interrupt) {
-          status = state.interrupt((void *) &state, 0);
-
-          if (F_status_set_fine(status) == F_interrupt) {
-            return F_status_set_error(F_interrupt);
-          }
-        }
-
-        ++range->start;
-
-        if (range->start >= buffer.used) {
-          return F_data_not_eos;
-        }
-
-        if (range->start > range->stop) {
-          return F_data_not_stop;
-        }
-      } // while
+      status = f_fss_seek_to_eol(state, buffer, range);
+      if (F_status_is_error(status)) return status;
+      if (range->start >= buffer.used) return F_data_not_eos;
+      if (range->start > range->stop) return F_data_not_stop;
 
       // Move the start position to after the EOL.
       ++range->start;
@@ -180,9 +468,7 @@ extern "C" {
     // Handle quote support.
     f_char_t quote_found = 0;
 
-    if (quote) {
-      *quote = f_fss_quote_type_none_e;
-    }
+    if (quote) *quote = f_fss_quote_type_none_e;
 
     // Identify where the object begins.
     if (buffer.string[range->start] == f_fss_delimit_slash_s.string[0]) {
@@ -197,12 +483,7 @@ extern "C" {
 
         if (state.interrupt) {
           status = state.interrupt((void *) &state, 0);
-
-          if (F_status_set_fine(status) == F_interrupt) {
-            status = F_status_set_error(F_interrupt);
-
-            break;
-          }
+          if (F_status_set_fine(status) == F_interrupt) return F_status_set_error(F_interrupt);
         }
 
         status = f_fss_is_zero_width(state, buffer, *range);
@@ -210,7 +491,7 @@ extern "C" {
 
         if (status == F_true) {
           status = f_utf_buffer_increment(buffer, range, 1);
-          if (F_status_is_error(status)) break;
+          if (F_status_is_error(status)) return status;
 
           continue;
         }
@@ -230,24 +511,18 @@ extern "C" {
             }
 
             status = f_utf_buffer_increment(buffer, range, 1);
-            if (F_status_is_error(status)) break;
-
-            if (buffer.string[range->start] == f_fss_eol_s.string[0]) {
-              return F_fss_found_object_content_not;
-            }
+            if (F_status_is_error(status)) return status;
 
-            return F_fss_found_object;
+            return buffer.string[range->start] == f_fss_eol_s.string[0] ? F_fss_found_object_content_not : F_fss_found_object;
           }
 
           break;
         }
 
         status = f_utf_buffer_increment(buffer, range, 1);
-        if (F_status_is_error(status)) break;
+        if (F_status_is_error(status)) return status;
       } // while
 
-      if (F_status_is_error(status)) return status;
-
       if (range->start >= buffer.used) {
         found->stop = buffer.used - 1;
 
@@ -268,18 +543,12 @@ extern "C" {
         if (F_status_is_error(status)) return status;
 
         delimits->array[delimits->used++] = first_slash;
-
-        status = f_utf_buffer_increment(buffer, range, 1);
-        if (F_status_is_error(status)) return status;
+        ++range->start;
       }
     }
     else if (!(flag & 0x2) && (buffer.string[range->start] == f_fss_quote_single_s.string[0] || buffer.string[range->start] == f_fss_delimit_quote_double_s.string[0] || buffer.string[range->start] == f_fss_quote_backtick_s.string[0])) {
       quote_found = buffer.string[range->start];
-
-      status = f_utf_buffer_increment(buffer, range, 1);
-      if (F_status_is_error(status)) return status;
-
-      found->start = range->start;
+      found->start = ++range->start;
     }
 
     // Identify where the object ends.
@@ -292,10 +561,7 @@ extern "C" {
 
         if (state.interrupt) {
           status = state.interrupt((void *) &state, 0);
-
-          if (F_status_set_fine(status) == F_interrupt) {
-            return F_status_set_error(F_interrupt);
-          }
+          if (F_status_set_fine(status) == F_interrupt) return F_status_set_error(F_interrupt);
         }
 
         if (buffer.string[range->start] == f_fss_delimit_slash_s.string[0]) {
@@ -309,10 +575,7 @@ extern "C" {
 
             if (state.interrupt) {
               status = state.interrupt((void *) &state, 0);
-
-              if (F_status_set_fine(status) == F_interrupt) {
-                return F_status_set_error(F_interrupt);
-              }
+              if (F_status_set_fine(status) == F_interrupt) return F_status_set_error(F_interrupt);
             }
 
             if (buffer.string[range->start] == f_fss_delimit_placeholder_s.string[0]) {
@@ -393,7 +656,7 @@ extern "C" {
                 status = f_array_lengths_increase_by(slash_count / 2, delimits);
                 if (F_status_is_error(status)) return status;
 
-                while (slash_count > 0) {
+                while (slash_count) {
 
                   if (buffer.string[range->start] == f_fss_delimit_slash_s.string[0]) {
                     if (slash_count % 2 == 1) {
@@ -402,10 +665,12 @@ extern "C" {
                     }
 
                     --slash_count;
+                    ++range->start;
+                  }
+                  else {
+                    status = f_utf_buffer_increment(buffer, range, 1);
+                    if (F_status_is_error(status)) return status;
                   }
-
-                  status = f_utf_buffer_increment(buffer, range, 1);
-                  if (F_status_is_error(status)) return status;
                 } // while
 
                 range->start = location + 1;
@@ -433,10 +698,7 @@ extern "C" {
 
                     if (state.interrupt) {
                       status = state.interrupt((void *) &state, 0);
-
-                      if (F_status_set_fine(status) == F_interrupt) {
-                        return F_status_set_error(F_interrupt);
-                      }
+                      if (F_status_set_fine(status) == F_interrupt) return F_status_set_error(F_interrupt);
                     }
 
                     status = f_utf_buffer_increment(buffer, range, 1);
@@ -481,7 +743,7 @@ extern "C" {
                 status = f_array_lengths_increase_by((slash_count / 2) + 1, delimits);
                 if (F_status_is_error(status)) return status;
 
-                while (slash_count > 0) {
+                while (slash_count) {
 
                   if (buffer.string[range->start] == f_fss_delimit_slash_s.string[0]) {
                     if (slash_count % 2 == 1) {
@@ -489,10 +751,12 @@ extern "C" {
                     }
 
                     --slash_count;
+                    ++range->start;
+                  }
+                  else {
+                    status = f_utf_buffer_increment(buffer, range, 1);
+                    if (F_status_is_error(status)) return status;
                   }
-
-                  status = f_utf_buffer_increment(buffer, range, 1);
-                  if (F_status_is_error(status)) return status;
                 } // while
 
                 range->start = location;
@@ -565,10 +829,7 @@ extern "C" {
 
               if (state.interrupt) {
                 status = state.interrupt((void *) &state, 0);
-
-                if (F_status_set_fine(status) == F_interrupt) {
-                  return F_status_set_error(F_interrupt);
-                }
+                if (F_status_set_fine(status) == F_interrupt) return F_status_set_error(F_interrupt);
               }
 
               if (buffer.string[range->start] == f_fss_eol_s.string[0]) {
@@ -584,9 +845,8 @@ extern "C" {
 
               if (status == F_true) {
                 status = f_utf_buffer_increment(buffer, range, 1);
-                if (F_status_is_error(status)) return status;
 
-                return F_fss_found_object;
+                return F_status_is_error(status) ? status : F_fss_found_object;
               }
 
               if (buffer.string[range->start] != f_fss_delimit_placeholder_s.string[0]) {
@@ -594,10 +854,7 @@ extern "C" {
 
                   if (state.interrupt) {
                     status = state.interrupt((void *) &state, 0);
-
-                    if (F_status_set_fine(status) == F_interrupt) {
-                      return F_status_set_error(F_interrupt);
-                    }
+                    if (F_status_set_fine(status) == F_interrupt) return F_status_set_error(F_interrupt);
                   }
 
                   status = f_utf_buffer_increment(buffer, range, 1);
@@ -617,9 +874,8 @@ extern "C" {
                 }
 
                 status = f_utf_buffer_increment(buffer, range, 1);
-                if (F_status_is_error(status)) return status;
 
-                return F_fss_found_object_not;
+                return F_status_is_error(status) ? status : F_fss_found_object_not;
               }
 
               status = f_utf_buffer_increment(buffer, range, 1);
@@ -708,7 +964,12 @@ extern "C" {
         if (F_status_is_error(status)) break;
       } // while
 
-      if (F_status_is_error(status)) return status;
+      if (F_status_is_error(status)) {
+        found->start = 1;
+        found->stop = 0;
+
+        return status;
+      }
 
       if (range->start > begin) {
         found->stop = range->start - 1;
@@ -761,14 +1022,19 @@ extern "C" {
     const f_array_length_t input_start = range->start;
     const f_array_length_t used_start = destination->used;
 
-    bool quote_is = F_false;
-    bool commented = F_false;
+    uint8_t quote_is = F_false;
+    uint8_t commented = F_false;
+    uint8_t width = 0;
 
     f_array_length_t item_first = 0;
     f_array_length_t item_total = 0;
     f_array_length_t i = 0;
 
-    const f_char_t quote_char = quote == f_fss_quote_type_double_e ? f_string_ascii_quote_double_s.string[0] : f_string_ascii_quote_single_s.string[0];
+    const f_char_t quote_char = quote == f_fss_quote_type_single_e
+      ? f_string_ascii_quote_single_s.string[0]
+      : quote == f_fss_quote_type_backtick_e
+        ? f_string_ascii_grave_s.string[0]
+        : f_string_ascii_quote_double_s.string[0];
 
     // Use placeholders for potential quote and potential delimited quote to avoid doing things such as memmove().
     destination->string[destination->used++] = f_fss_delimit_placeholder_s.string[0];
@@ -782,8 +1048,6 @@ extern "C" {
       commented = F_true;
     }
 
-    uint8_t width = 0;
-
     for (; range->start <= range->stop && range->start < object.used; ) {
 
       if (state.interrupt) {
@@ -865,7 +1129,6 @@ extern "C" {
           if (F_status_is_error(status)) break;
 
           if (range->start > range->stop || range->start >= object.used) {
-
             status = f_string_dynamic_increase_by(item_total + 1, destination);
             if (F_status_is_error(status)) break;
 
@@ -1054,10 +1317,7 @@ extern "C" {
             status = f_fss_skip_past_delimit(state, object, range);
             if (F_status_is_error(status)) return status;
 
-            if (range->start > range->stop || range->start >= object.used) {
-              quote_is = F_true;
-            }
-            else if (object.string[range->start] == object.string[item_first]) {
+            if (range->start > range->stop || range->start >= object.used || object.string[range->start] == object.string[item_first]) {
               quote_is = F_true;
             }
             else {
@@ -1114,7 +1374,6 @@ extern "C" {
 
       // The start quote may or may not need to be delimited in this case.
       if (destination->string[input_start] == quote_char) {
-
         for (i = input_start + macro_f_utf_byte_width(object.string[input_start]); i <= range->stop && i < object.used; i += macro_f_utf_byte_width(object.string[i])) {
 
           if (state.interrupt) {
index baf69ee6b9b134da97e82d1424280e8fc5b3a22f..f7558658794080e3a2a969979b751e56621a2ba0 100644 (file)
@@ -16,6 +16,74 @@ extern "C" {
 #endif
 
 /**
+ * Read a standard list Object where the list open is specific to a given FSS standard.
+ *
+ * This will record where delimit placeholders exist but will not apply the delimits.
+ *
+ * @param list_open
+ *   The list open character for the given standard.
+ *   This must be defined where list_open.used = 1.
+ * @param buffer
+ *   The buffer to read from.
+ * @param state
+ *   A state for providing flags and handling interrupts during long running operations.
+ *   There is no state.handle().
+ *   There is no "callbacks" structure.
+ *   There is no data structure passed to these functions.
+ *
+ *   When state.interrupt() returns, only F_interrupt and F_interrupt_not are processed.
+ *   Error bit designates an error but must be passed along with F_interrupt.
+ *   All other statuses are ignored.
+ * @param range
+ *   The start/stop location within the buffer to be processed.
+ *   The start location will be updated as the buffer is being processed.
+ *   The start location will represent where the read stopped on return.
+ *   A start location past the stop location or buffer used means that the entire range was processed.
+ * @param found
+ *   A location where a valid object was found.
+ * @param delimits
+ *   A delimits array representing where delimits exist within the buffer.
+ *
+ * @return
+ *   F_fss_found_object on success and object was found (start location is at end of object).
+ *   F_fss_found_object_not on success and no object was found (start location is after character designating this is not an object).
+ *   F_none_eos on success after reaching the end of the buffer (a valid object is not yet confirmed).
+ *   F_none_stop on success after reaching stopping point (a valid object is not yet confirmed).
+ *   F_data_not_eos no objects found after reaching the end of the buffer (essentially only comments are found).
+ *   F_data_not_stop no data found after reaching stopping point (essentially only comments are found).
+ *   F_end_not_group_eos if EOS was reached before the a group termination was reached.
+ *   F_end_not_group_stop if stop point was reached before the a group termination was reached.
+ *
+ *   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_array_lengths_increase_by().
+ *   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_utf_buffer_increment().
+ *
+ * @see f_array_lengths_increase_by()
+ * @see f_fss_is_graph()
+ * @see f_fss_is_space()
+ * @see f_fss_is_zero_width()
+ * @see f_fss_seek_to_eol()
+ * @see f_fss_skip_past_delimit()
+ * @see f_fss_skip_past_space()
+ * @see f_utf_buffer_increment()
+ *
+ * @see fl_fss_basic_list_object_read()
+ * @see fl_fss_embedded_list_object_read()
+ * @see fl_fss_extended_list_object_read()
+ */
+#if !defined(_di_fl_fss_basic_list_object_read_) || !defined(_di_fl_fss_embedded_list_object_read_) || !defined(_di_fl_fss_extended_list_object_read_)
+  extern f_status_t private_fl_fss_list_object_read(const f_string_static_t list_open, const f_string_static_t buffer, f_state_t state, f_string_range_t * const range, f_fss_object_t * const found, f_fss_delimits_t * const delimits) F_attribute_visibility_internal_d;
+#endif // !defined(_di_fl_fss_basic_list_object_read_) || !defined(_di_fl_fss_embedded_list_object_read_) || !defined(_di_fl_fss_extended_list_object_read_)
+
+/**
  * Add all bytes to destination until stop point, buffer end, or EOL.
  *
  * @param buffer
@@ -47,7 +115,7 @@ extern "C" {
  * @see fl_fss_extended_list_content_write()
  */
 #if !defined(_di_fl_fss_basic_list_content_write_) || !defined(_di_fl_fss_extended_list_content_write_) || !defined(_di_fl_fss_embedded_list_content_write_)
-  extern f_status_t private_fl_fss_basic_list_write_add_until_end(const f_string_static_t buffer, f_state_t state, f_string_range_t * const range, f_string_dynamic_t * const destination) F_attribute_visibility_internal_d;
+  extern f_status_t private_fl_fss_list_write_add_until_end(const f_string_static_t buffer, f_state_t state, f_string_range_t * const range, f_string_dynamic_t * const destination) F_attribute_visibility_internal_d;
 #endif // !defined(_di_fl_fss_basic_list_content_write_) || !defined(_di_fl_fss_extended_list_content_write_) || !defined(_di_fl_fss_embedded_list_content_write_)
 
 /**
@@ -79,7 +147,7 @@ extern "C" {
  * @see fl_fss_extended_list_object_write()
  */
 #if !defined(_di_fl_fss_basic_list_object_write_) || !defined(_di_fl_fss_extended_list_object_write_)
-  extern f_status_t private_fl_fss_basic_list_write_object_trim(const f_array_length_t used_start, f_state_t state, f_string_dynamic_t * const destination) F_attribute_visibility_internal_d;
+  extern f_status_t private_fl_fss_list_write_object_trim(const f_array_length_t used_start, f_state_t state, f_string_dynamic_t * const destination) F_attribute_visibility_internal_d;
 #endif // !defined(_di_fl_fss_basic_list_object_write_) || !defined(_di_fl_fss_extended_list_object_write_)
 
 /**
index 37f44ffa07b491f169b343b09b495629632f4591..558a2bf9b4ad8384171b526f1df11bf61dbc7b34 100644 (file)
@@ -393,9 +393,7 @@ extern "C" {
 
         if (depths.array[depths_index].value_at < items->used && !skip[depths.array[depths_index].value_at]) {
           if (depths.array[depths_index].index_name) {
-
             if (data->main->parameters.array[fss_embedded_list_read_parameter_trim_e].result == f_console_result_found_e) {
-
               if (fl_string_dynamic_partial_compare_except_trim_dynamic(depths.array[depths_index].value_name, data->buffer, items->array[depths.array[depths_index].value_at].object, except_none, *objects_delimits) != F_equal_to) {
                 skip[depths.array[depths_index].value_at] = F_true;
               }
@@ -464,7 +462,7 @@ extern "C" {
         parents_next.skip = skip_next;
         parents_next.used = data->nest.depth[parents_depth].used;
 
-        memset(skip_next, F_true, sizeof(skip_next) * parents_next.used);
+        memset(skip_next, F_true, sizeof(bool) * parents_next.used);
 
         f_fss_items_t *items_next = &data->nest.depth[depth_next];
         f_fss_items_t *items_previous = 0;
@@ -533,14 +531,16 @@ extern "C" {
       }
 
       if (data->main->parameters.array[fss_embedded_list_read_parameter_columns_e].result == f_console_result_found_e) {
-        for (i = 0; i < items->used; ++i) {
+        if (data->main->parameters.array[fss_embedded_list_read_parameter_content_e].result == f_console_result_found_e) {
+          for (i = 0; i < items->used; ++i) {
 
-          if (skip[i]) continue;
+            if (skip[i]) continue;
 
-          fll_print_format("%r%r", data->main->output.to.stream, f_string_ascii_1_s, f_string_eol_s);
+            fll_print_format("%r%r", data->main->output.to.stream, f_string_ascii_1_s, f_string_eol_s);
 
-          return F_none;
-        } // for
+            return F_none;
+          } // for
+        }
 
         fll_print_format("%r%r", data->main->output.to.stream, f_string_ascii_0_s, f_string_eol_s);
 
@@ -790,7 +790,7 @@ extern "C" {
 
       if (skip[i]) continue;
 
-      if (!items->array[i].content.used) {
+      if (!items->array[i].content.used || items->array[i].content.array[0].start > items->array[i].content.array[0].stop) {
         if (include_empty) {
           fss_embedded_list_read_print_set_end(data);
         }
index 65b0a48c6425f622a732200ffd9e43a94511843a..8b46f9e4caf9209502375d3a8bee7231c7d67642 100644 (file)
@@ -2,12 +2,12 @@ empty
 d
 a
 привет
-y 
+y
 "мир"
 привет has space
 "This is quoted"
 AlsoGood
-hi     
-привет has space   
+hi
+привет has space
 a
 also_empty
index 65b0a48c6425f622a732200ffd9e43a94511843a..8b46f9e4caf9209502375d3a8bee7231c7d67642 100644 (file)
@@ -2,12 +2,12 @@ empty
 d
 a
 привет
-y 
+y
 "мир"
 привет has space
 "This is quoted"
 AlsoGood
-hi     
-привет has space   
+hi
+привет has space
 a
 also_empty
index 65b0a48c6425f622a732200ffd9e43a94511843a..8b46f9e4caf9209502375d3a8bee7231c7d67642 100644 (file)
@@ -2,12 +2,12 @@ empty
 d
 a
 привет
-y 
+y
 "мир"
 привет has space
 "This is quoted"
 AlsoGood
-hi     
-привет has space   
+hi
+привет has space
 a
 also_empty
index a3d6a83895d0106cc7e163b51eb098074a41f8c7..40efceb3112da24e68b3beb647d6d3794b3d0de0 100644 (file)
@@ -10,7 +10,7 @@ a{
 привет{
   мир
 }
-y {
+y{
   z
 }
 "мир"{
@@ -24,10 +24,10 @@ y {
 }
 AlsoGood{
 }
-hi     {
+hi{
   Check this.
 }
-привет has space   {
+привет has space{
   ...
 }
 a{
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..40efceb3112da24e68b3beb647d6d3794b3d0de0 100644 (file)
@@ -0,0 +1,37 @@
+empty{
+}
+d{
+  b c
+}
+a{
+  e f
+  g h
+}
+привет{
+  мир
+}
+y{
+  z
+}
+"мир"{
+  quoted, "yep".
+}
+привет has space{
+  \"and so does this" "have space"
+}
+"This is quoted"{
+  But still a valid list.
+}
+AlsoGood{
+}
+hi{
+  Check this.
+}
+привет has space{
+  ...
+}
+a{
+  a second "a".
+}
+also_empty{
+}
index a3d6a83895d0106cc7e163b51eb098074a41f8c7..40efceb3112da24e68b3beb647d6d3794b3d0de0 100644 (file)
@@ -10,7 +10,7 @@ a{
 привет{
   мир
 }
-y {
+y{
   z
 }
 "мир"{
@@ -24,10 +24,10 @@ y {
 }
 AlsoGood{
 }
-hi     {
+hi{
   Check this.
 }
-привет has space   {
+привет has space{
   ...
 }
 a{
index a3d6a83895d0106cc7e163b51eb098074a41f8c7..40efceb3112da24e68b3beb647d6d3794b3d0de0 100644 (file)
@@ -10,7 +10,7 @@ a{
 привет{
   мир
 }
-y {
+y{
   z
 }
 "мир"{
@@ -24,10 +24,10 @@ y {
 }
 AlsoGood{
 }
-hi     {
+hi{
   Check this.
 }
-привет has space   {
+привет has space{
   ...
 }
 a{
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..d3d4ce359345badf51ca5de5f1a25c4d5ae15580 100644 (file)
@@ -0,0 +1,33 @@
+a{
+a b привет
+c d
+ \# not a comment
+ \\\# nor is this.
+\\# even this is not.
+привет мир a 
+  
+ \# a valid list:
+   with content.
+}
+a{
+  another "A" list.
+}
+"мир"{
+  quoted, "yep".
+}
+привет has space{
+  But this is not a comment.
+}
+empty{
+}
+hi{
+  not a list\:
+  a b привет
+  c d
+  привет мир a 
+
+}
+has spaces{
+  yep.
+  fin  
+}
index 65b0a48c6425f622a732200ffd9e43a94511843a..8b46f9e4caf9209502375d3a8bee7231c7d67642 100644 (file)
@@ -2,12 +2,12 @@ empty
 d
 a
 привет
-y 
+y
 "мир"
 привет has space
 "This is quoted"
 AlsoGood
-hi     
-привет has space   
+hi
+привет has space
 a
 also_empty
index 65b0a48c6425f622a732200ffd9e43a94511843a..8b46f9e4caf9209502375d3a8bee7231c7d67642 100644 (file)
@@ -2,12 +2,12 @@ empty
 d
 a
 привет
-y 
+y
 "мир"
 привет has space
 "This is quoted"
 AlsoGood
-hi     
-привет has space   
+hi
+привет has space
 a
 also_empty
index 65b0a48c6425f622a732200ffd9e43a94511843a..8b46f9e4caf9209502375d3a8bee7231c7d67642 100644 (file)
@@ -2,12 +2,12 @@ empty
 d
 a
 привет
-y 
+y
 "мир"
 привет has space
 "This is quoted"
 AlsoGood
-hi     
-привет has space   
+hi
+привет has space
 a
 also_empty
index 65b0a48c6425f622a732200ffd9e43a94511843a..8b46f9e4caf9209502375d3a8bee7231c7d67642 100644 (file)
@@ -2,12 +2,12 @@ empty
 d
 a
 привет
-y 
+y
 "мир"
 привет has space
 "This is quoted"
 AlsoGood
-hi     
-привет has space   
+hi
+привет has space
 a
 also_empty
index a3d6a83895d0106cc7e163b51eb098074a41f8c7..40efceb3112da24e68b3beb647d6d3794b3d0de0 100644 (file)
@@ -10,7 +10,7 @@ a{
 привет{
   мир
 }
-y {
+y{
   z
 }
 "мир"{
@@ -24,10 +24,10 @@ y {
 }
 AlsoGood{
 }
-hi     {
+hi{
   Check this.
 }
-привет has space   {
+привет has space{
   ...
 }
 a{
index a3d6a83895d0106cc7e163b51eb098074a41f8c7..40efceb3112da24e68b3beb647d6d3794b3d0de0 100644 (file)
@@ -10,7 +10,7 @@ a{
 привет{
   мир
 }
-y {
+y{
   z
 }
 "мир"{
@@ -24,10 +24,10 @@ y {
 }
 AlsoGood{
 }
-hi     {
+hi{
   Check this.
 }
-привет has space   {
+привет has space{
   ...
 }
 a{
index a3d6a83895d0106cc7e163b51eb098074a41f8c7..40efceb3112da24e68b3beb647d6d3794b3d0de0 100644 (file)
@@ -10,7 +10,7 @@ a{
 привет{
   мир
 }
-y {
+y{
   z
 }
 "мир"{
@@ -24,10 +24,10 @@ y {
 }
 AlsoGood{
 }
-hi     {
+hi{
   Check this.
 }
-привет has space   {
+привет has space{
   ...
 }
 a{
index a3d6a83895d0106cc7e163b51eb098074a41f8c7..40efceb3112da24e68b3beb647d6d3794b3d0de0 100644 (file)
@@ -10,7 +10,7 @@ a{
 привет{
   мир
 }
-y {
+y{
   z
 }
 "мир"{
@@ -24,10 +24,10 @@ y {
 }
 AlsoGood{
 }
-hi     {
+hi{
   Check this.
 }
-привет has space   {
+привет has space{
   ...
 }
 a{