]> Kevux Git Server - fll/commitdiff
Progress: Continue working on getting FSS Embedded Read working.
authorKevin Day <Kevin@kevux.org>
Wed, 28 Aug 2024 03:26:32 +0000 (22:26 -0500)
committerKevin Day <Kevin@kevux.org>
Wed, 28 Aug 2024 03:26:32 +0000 (22:26 -0500)
The runtime tests currently pass but I am not done with the changes.

Fix several problems with the Embedded List processing from fl_fss.
- The comments are now being handled correctly along with the `close`.

I noticed that the `--columns` could be opposing `--object` and `--content`.
This would make more sense as the combination of `--object` is meaningless.
I could also just throw a parameter error the `--columns` cannot be used with `--object`.
Then I could update the runtime tests to make more sense regarding the combination of `--object` and `--columns`.

84 files changed:
level_1/fl_fss/c/fss/embedded_list.c
level_3/fss_read/c/embedded_list/process_normal.c
level_3/fss_read/tests/runtime/fss_0008/expect/test-0000-basic-content-name-hi-select-0-empty-total.expect
level_3/fss_read/tests/runtime/fss_0008/expect/test-0000-basic-content-name-hi-select-0-empty.expect
level_3/fss_read/tests/runtime/fss_0008/expect/test-0000-basic-content-name-hi-select-0-total.expect
level_3/fss_read/tests/runtime/fss_0008/expect/test-0000-basic-content-name-hi-select-0.expect
level_3/fss_read/tests/runtime/fss_0008/expect/test-0000-basic-content-name-hi-total.expect
level_3/fss_read/tests/runtime/fss_0008/expect/test-0000-basic-content-name-hi.expect
level_3/fss_read/tests/runtime/fss_0008/expect/test-0000-basic-content-name-привет_has_space-select-0-total.expect
level_3/fss_read/tests/runtime/fss_0008/expect/test-0000-basic-content-name-привет_has_space-select-0.expect
level_3/fss_read/tests/runtime/fss_0008/expect/test-0000-basic-content-name-привет_has_space-total.expect
level_3/fss_read/tests/runtime/fss_0008/expect/test-0000-basic-content-name-привет_has_space.expect
level_3/fss_read/tests/runtime/fss_0008/expect/test-0000-basic-object-columns.expect
level_3/fss_read/tests/runtime/fss_0008/expect/test-0000-basic-object-line-0-original.expect
level_3/fss_read/tests/runtime/fss_0008/expect/test-0000-basic-object-line-1-original.expect
level_3/fss_read/tests/runtime/fss_0008/expect/test-0000-basic-object-line-5-original.expect
level_3/fss_read/tests/runtime/fss_0008/expect/test-0000-basic-object-line-6-original.expect
level_3/fss_read/tests/runtime/fss_0008/expect/test-0000-basic-object-name-a-columns-empty.expect
level_3/fss_read/tests/runtime/fss_0008/expect/test-0000-basic-object-name-a-columns.expect
level_3/fss_read/tests/runtime/fss_0008/expect/test-0000-basic-object-name-hi-select-0-empty-total.expect
level_3/fss_read/tests/runtime/fss_0008/expect/test-0000-basic-object-name-hi-select-0-empty.expect
level_3/fss_read/tests/runtime/fss_0008/expect/test-0000-basic-object-name-hi-select-0-total.expect
level_3/fss_read/tests/runtime/fss_0008/expect/test-0000-basic-object-name-hi-select-0.expect
level_3/fss_read/tests/runtime/fss_0008/expect/test-0000-basic-object-name-hi-total.expect
level_3/fss_read/tests/runtime/fss_0008/expect/test-0000-basic-object-name-hi.expect
level_3/fss_read/tests/runtime/fss_0008/expect/test-0000-basic-object-name-привет_has_space-select-0-total.expect
level_3/fss_read/tests/runtime/fss_0008/expect/test-0000-basic-object-name-привет_has_space-total.expect
level_3/fss_read/tests/runtime/fss_0008/expect/test-0000-basic-object-name-привет_has_space.expect
level_3/fss_read/tests/runtime/fss_0008/expect/test-0000-basic-object-select-0-original.expect
level_3/fss_read/tests/runtime/fss_0008/expect/test-0000-basic-object_and_content-line-0-original.expect
level_3/fss_read/tests/runtime/fss_0008/expect/test-0000-basic-object_and_content-line-1-original.expect
level_3/fss_read/tests/runtime/fss_0008/expect/test-0000-basic-object_and_content-line-5-original.expect
level_3/fss_read/tests/runtime/fss_0008/expect/test-0000-basic-object_and_content-line-6-original.expect
level_3/fss_read/tests/runtime/fss_0008/expect/test-0000-basic-object_and_content-name-hi-select-0-empty-total.expect
level_3/fss_read/tests/runtime/fss_0008/expect/test-0000-basic-object_and_content-name-hi-select-0-empty.expect
level_3/fss_read/tests/runtime/fss_0008/expect/test-0000-basic-object_and_content-name-hi-select-0-total.expect
level_3/fss_read/tests/runtime/fss_0008/expect/test-0000-basic-object_and_content-name-hi-select-0.expect
level_3/fss_read/tests/runtime/fss_0008/expect/test-0000-basic-object_and_content-name-hi-total.expect
level_3/fss_read/tests/runtime/fss_0008/expect/test-0000-basic-object_and_content-name-hi.expect
level_3/fss_read/tests/runtime/fss_0008/expect/test-0000-basic-object_and_content-name-привет_has_space-select-0-total.expect
level_3/fss_read/tests/runtime/fss_0008/expect/test-0000-basic-object_and_content-name-привет_has_space-select-0.expect
level_3/fss_read/tests/runtime/fss_0008/expect/test-0000-basic-object_and_content-name-привет_has_space-total.expect
level_3/fss_read/tests/runtime/fss_0008/expect/test-0000-basic-object_and_content-select-0-original.expect
level_3/fss_read/tests/runtime/fss_0008/expect/test-0001-empty_name_list-content-name-a-columns.expect
level_3/fss_read/tests/runtime/fss_0008/expect/test-0001-empty_name_list-object-columns.expect
level_3/fss_read/tests/runtime/fss_0008/expect/test-0001-empty_name_list-object-line-0-original.expect
level_3/fss_read/tests/runtime/fss_0008/expect/test-0001-empty_name_list-object-line-1-original.expect
level_3/fss_read/tests/runtime/fss_0008/expect/test-0001-empty_name_list-object-line-5-original.expect
level_3/fss_read/tests/runtime/fss_0008/expect/test-0001-empty_name_list-object-line-6-original.expect
level_3/fss_read/tests/runtime/fss_0008/expect/test-0001-empty_name_list-object-name-a-columns-empty.expect
level_3/fss_read/tests/runtime/fss_0008/expect/test-0001-empty_name_list-object-name-a-columns.expect
level_3/fss_read/tests/runtime/fss_0008/expect/test-0001-empty_name_list-object-name-a-original-empty.expect
level_3/fss_read/tests/runtime/fss_0008/expect/test-0001-empty_name_list-object-name-a-original.expect
level_3/fss_read/tests/runtime/fss_0008/expect/test-0001-empty_name_list-object-name-a-select-0-total.expect
level_3/fss_read/tests/runtime/fss_0008/expect/test-0001-empty_name_list-object-name-a-select-0.expect
level_3/fss_read/tests/runtime/fss_0008/expect/test-0001-empty_name_list-object-name-a-total.expect
level_3/fss_read/tests/runtime/fss_0008/expect/test-0001-empty_name_list-object-name-a.expect
level_3/fss_read/tests/runtime/fss_0008/expect/test-0001-empty_name_list-object-select-0-original.expect
level_3/fss_read/tests/runtime/fss_0008/expect/test-0001-empty_name_list-object_and_content-line-0-original.expect
level_3/fss_read/tests/runtime/fss_0008/expect/test-0001-empty_name_list-object_and_content-line-1-original.expect
level_3/fss_read/tests/runtime/fss_0008/expect/test-0001-empty_name_list-object_and_content-line-5-original.expect
level_3/fss_read/tests/runtime/fss_0008/expect/test-0001-empty_name_list-object_and_content-line-6-original.expect
level_3/fss_read/tests/runtime/fss_0008/expect/test-0001-empty_name_list-object_and_content-name-a-columns.expect
level_3/fss_read/tests/runtime/fss_0008/expect/test-0001-empty_name_list-object_and_content-name-a-original-empty.expect
level_3/fss_read/tests/runtime/fss_0008/expect/test-0001-empty_name_list-object_and_content-name-a-original.expect
level_3/fss_read/tests/runtime/fss_0008/expect/test-0001-empty_name_list-object_and_content-name-a-select-0-total.expect
level_3/fss_read/tests/runtime/fss_0008/expect/test-0001-empty_name_list-object_and_content-name-a-select-0.expect
level_3/fss_read/tests/runtime/fss_0008/expect/test-0001-empty_name_list-object_and_content-name-a-total.expect
level_3/fss_read/tests/runtime/fss_0008/expect/test-0001-empty_name_list-object_and_content-name-a.expect
level_3/fss_read/tests/runtime/fss_0008/expect/test-0001-empty_name_list-object_and_content-select-0-original.expect
level_3/fss_read/tests/runtime/fss_0008/expect/test-0002-mixed-object-columns.expect
level_3/fss_read/tests/runtime/fss_0008/expect/test-0002-mixed-object-line-0-original.expect
level_3/fss_read/tests/runtime/fss_0008/expect/test-0002-mixed-object-line-1-original.expect
level_3/fss_read/tests/runtime/fss_0008/expect/test-0002-mixed-object-line-5-original.expect
level_3/fss_read/tests/runtime/fss_0008/expect/test-0002-mixed-object-line-6-original.expect
level_3/fss_read/tests/runtime/fss_0008/expect/test-0002-mixed-object-name-a-columns-empty.expect
level_3/fss_read/tests/runtime/fss_0008/expect/test-0002-mixed-object-name-a-columns.expect
level_3/fss_read/tests/runtime/fss_0008/expect/test-0002-mixed-object-select-0-original.expect
level_3/fss_read/tests/runtime/fss_0008/expect/test-0002-mixed-object_and_content-line-0-original.expect
level_3/fss_read/tests/runtime/fss_0008/expect/test-0002-mixed-object_and_content-line-1-original.expect
level_3/fss_read/tests/runtime/fss_0008/expect/test-0002-mixed-object_and_content-line-5-original.expect
level_3/fss_read/tests/runtime/fss_0008/expect/test-0002-mixed-object_and_content-line-5.expect
level_3/fss_read/tests/runtime/fss_0008/expect/test-0002-mixed-object_and_content-line-6-original.expect
level_3/fss_read/tests/runtime/fss_0008/expect/test-0002-mixed-object_and_content-select-0-original.expect

index 668f1d6fe6828019c57fbd176482696122106506..2e18dcee08cc32b0b281cf8095efee3370009023 100644 (file)
@@ -64,7 +64,7 @@ extern "C" {
     uint8_t is_open = F_false;
 
     // 0x0 = false, 0x1 = true, 0x2 = false, but there is a delimited comment, comment_delimit is set.
-    uint8_t graph_first = 0x0;
+    uint8_t graph_first = 0x1;
 
     // Initialize depth 1 start position.
     // Positions_start.used is used as a max depth (such that cache->positions->used == max depth + 1).
@@ -92,6 +92,7 @@ extern "C" {
         newline_last = range->start;
         position_previous = range->start++;
         graph_first = 0x1;
+        line_start = range->start;
 
         if (depth) {
           if (range->start >= buffer.used || range->start > range->stop) {
@@ -111,8 +112,6 @@ extern "C" {
           }
         }
 
-        line_start = range->start;
-
         continue;
       }
 
@@ -466,6 +465,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;
             }
@@ -501,8 +501,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) {
@@ -683,12 +681,11 @@ extern "C" {
         }
       }
       else if (graph_first == 0x1 && buffer.string[range->start] == f_fss_comment_s.string[0]) {
-        position = newline_last + 1;
 
-        f_fss_seek_to_eol(buffer, range, state);
-        if (F_status_is_error(state->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;
 
-        state->status = f_memory_array_increase(state->step_small, sizeof(f_range_t), (void **) &comments->array, &comments->used, &comments->size);
+        f_fss_seek_to_eol(buffer, range, state);
         if (F_status_is_error(state->status)) break;
 
         if (range->start > range->stop || range->start >= buffer.used) {
@@ -706,6 +703,9 @@ extern "C" {
           graph_first = 0x1;
         }
 
+        state->status = f_memory_array_increase(state->step_small, sizeof(f_range_t), (void **) &comments->array, &comments->used, &comments->size);
+        if (F_status_is_error(state->status)) break;
+
         comments->array[comments->used].start = position;
         comments->array[comments->used++].stop = range->start++;
 
@@ -793,19 +793,17 @@ extern "C" {
 
     const f_number_unsigned_t destination_used = destination->used;
 
-    bool is_comment = F_false;
-    bool ends_on_eol = F_false;
-    bool has_graph = F_false;
-    bool do_prepend = prepend ? F_true : F_false;
+    uint8_t is_comment = F_false;
+    uint8_t ends_on_eol = F_false;
+    uint8_t has_graph = F_false;
+    uint8_t do_prepend = prepend ? F_true : F_false;
+    uint8_t width = 0;
 
     f_number_unsigned_t i = 0;
+    f_number_unsigned_t r = 0;
     f_number_unsigned_t slash_count = 0;
     f_number_unsigned_t start = 0;
 
-    f_number_unsigned_t r = 0;
-
-    uint8_t width = 0;
-
     while (range->start <= range->stop && range->start < content.used) {
 
       if (state->interrupt) {
index 15ee63992f568eb54bfa67820bd76e26dc73c791..3665e4ae38445709d4de2c5d75efe0c1a4d93786 100644 (file)
@@ -15,6 +15,17 @@ extern "C" {
     // The process_load() callback is required to be non-NULL.
     if (!main->callback.process_load) return;
 
+    // This standard does not support multiple select, so any select greater than 0 can be predicted without processing the buffer.
+    if ((main->setting.flag & fss_read_main_flag_select_d) && main->setting.select) {
+      if (main->setting.flag & fss_read_main_flag_total_d) {
+        fss_read_print_number(&main->program.output, 0);
+      }
+
+      main->setting.state.status = F_okay;
+
+      return;
+    }
+
     // @todo this now needs to handle this case: main->setting.flag & fss_read_main_flag_depth_multiple_d and this case main->setting.flag & fss_read_main_flag_select_d.
 
     if (main->setting.buffer.used) {
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..65b0a48c6425f622a732200ffd9e43a94511843a 100644 (file)
@@ -0,0 +1,13 @@
+empty
+d
+a
+привет
+y 
+"мир"
+привет has space
+"This is quoted"
+AlsoGood
+hi     
+привет has space   
+a
+also_empty
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..a3d6a83895d0106cc7e163b51eb098074a41f8c7 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 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..f83a97dd529bcc2fe7f2a7076c34161f1a073b44 100644 (file)
@@ -0,0 +1,17 @@
+a{
+}
+hi{
+}
+a{
+}
+a  {
+}
+{
+  The object name is an empty string.
+}
+{
+}
+""{
+  Quotes aren't supported here, so this is not an empty object..
+\}
+}
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..025cdb431507752ab703bc835f0a7e8824509649 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  
+}