From f2cf8af02aefe9cbed0fee0770f3c78c4cbb2282 Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Wed, 4 Sep 2024 21:41:04 -0500 Subject: [PATCH] Bugfix: Bad handling of comments due to not re-assigning line start and fix mispelling in tests. The `valud` should be `valid`. --- level_1/fl_fss/c/fss/embedded_list.c | 3 ++- level_1/fl_fss/c/private-fss-list.c | 6 ++---- .../fss_0008/expect/test-0003-object_space-content-original.expect | 2 +- .../expect/test-0003-object_space-content-select-0-original.expect | 2 +- .../fss_0008/expect/test-0003-object_space-content-select-0.expect | 2 +- .../fss_0008/expect/test-0003-object_space-content-trim.expect | 2 +- .../runtime/fss_0008/expect/test-0003-object_space-content.expect | 2 +- .../test-0003-object_space-object_and_content-original.expect | 2 +- ...st-0003-object_space-object_and_content-select-0-original.expect | 2 +- .../test-0003-object_space-object_and_content-select-0.expect | 2 +- .../expect/test-0003-object_space-object_and_content-trim.expect | 2 +- .../expect/test-0003-object_space-object_and_content.expect | 2 +- .../tests/runtime/fss_0008/source/test-0003-object_space.fss | 2 +- 13 files changed, 15 insertions(+), 16 deletions(-) diff --git a/level_1/fl_fss/c/fss/embedded_list.c b/level_1/fl_fss/c/fss/embedded_list.c index e010e48..41c324a 100644 --- a/level_1/fl_fss/c/fss/embedded_list.c +++ b/level_1/fl_fss/c/fss/embedded_list.c @@ -754,7 +754,7 @@ extern "C" { } } } - else if (graph_first == 0x1 && buffer.string[range->start] == f_fss_comment_s.string[0]) { + else if (buffer.string[range->start] == f_fss_comment_s.string[0] && (graph_first == 0x1 || graph_first == 0x2)) { // 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; @@ -800,6 +800,7 @@ extern "C" { comments->array[comments->used].start = position; comments->array[comments->used++].stop = range->start++; + line_start = range->start; continue; } diff --git a/level_1/fl_fss/c/private-fss-list.c b/level_1/fl_fss/c/private-fss-list.c index 7b89330..e66f3d5 100644 --- a/level_1/fl_fss/c/private-fss-list.c +++ b/level_1/fl_fss/c/private-fss-list.c @@ -216,10 +216,8 @@ extern "C" { } } else if (graph_first && buffer.string[range->start] == f_fss_comment_s.string[0]) { - if (graph_first) { - graph_first = F_false; - start = slash_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. state->status = f_memory_array_increase(state->step_small, sizeof(f_number_unsigned_t), (void **) &delimits->array, &delimits->used, &delimits->size); diff --git a/level_3/fss_read/tests/runtime/fss_0008/expect/test-0003-object_space-content-original.expect b/level_3/fss_read/tests/runtime/fss_0008/expect/test-0003-object_space-content-original.expect index cc965da..0522138 100644 --- a/level_3/fss_read/tests/runtime/fss_0008/expect/test-0003-object_space-content-original.expect +++ b/level_3/fss_read/tests/runtime/fss_0008/expect/test-0003-object_space-content-original.expect @@ -6,7 +6,7 @@ inside { } with content. - \### Nested valud Object { + \### Nested valid Object { with nested content. } and outside. diff --git a/level_3/fss_read/tests/runtime/fss_0008/expect/test-0003-object_space-content-select-0-original.expect b/level_3/fss_read/tests/runtime/fss_0008/expect/test-0003-object_space-content-select-0-original.expect index cc965da..0522138 100644 --- a/level_3/fss_read/tests/runtime/fss_0008/expect/test-0003-object_space-content-select-0-original.expect +++ b/level_3/fss_read/tests/runtime/fss_0008/expect/test-0003-object_space-content-select-0-original.expect @@ -6,7 +6,7 @@ inside { } with content. - \### Nested valud Object { + \### Nested valid Object { with nested content. } and outside. diff --git a/level_3/fss_read/tests/runtime/fss_0008/expect/test-0003-object_space-content-select-0.expect b/level_3/fss_read/tests/runtime/fss_0008/expect/test-0003-object_space-content-select-0.expect index cc965da..0522138 100644 --- a/level_3/fss_read/tests/runtime/fss_0008/expect/test-0003-object_space-content-select-0.expect +++ b/level_3/fss_read/tests/runtime/fss_0008/expect/test-0003-object_space-content-select-0.expect @@ -6,7 +6,7 @@ inside { } with content. - \### Nested valud Object { + \### Nested valid Object { with nested content. } and outside. diff --git a/level_3/fss_read/tests/runtime/fss_0008/expect/test-0003-object_space-content-trim.expect b/level_3/fss_read/tests/runtime/fss_0008/expect/test-0003-object_space-content-trim.expect index cc965da..0522138 100644 --- a/level_3/fss_read/tests/runtime/fss_0008/expect/test-0003-object_space-content-trim.expect +++ b/level_3/fss_read/tests/runtime/fss_0008/expect/test-0003-object_space-content-trim.expect @@ -6,7 +6,7 @@ inside { } with content. - \### Nested valud Object { + \### Nested valid Object { with nested content. } and outside. diff --git a/level_3/fss_read/tests/runtime/fss_0008/expect/test-0003-object_space-content.expect b/level_3/fss_read/tests/runtime/fss_0008/expect/test-0003-object_space-content.expect index cc965da..0522138 100644 --- a/level_3/fss_read/tests/runtime/fss_0008/expect/test-0003-object_space-content.expect +++ b/level_3/fss_read/tests/runtime/fss_0008/expect/test-0003-object_space-content.expect @@ -6,7 +6,7 @@ inside { } with content. - \### Nested valud Object { + \### Nested valid Object { with nested content. } and outside. diff --git a/level_3/fss_read/tests/runtime/fss_0008/expect/test-0003-object_space-object_and_content-original.expect b/level_3/fss_read/tests/runtime/fss_0008/expect/test-0003-object_space-object_and_content-original.expect index f4a4077..f28125f 100644 --- a/level_3/fss_read/tests/runtime/fss_0008/expect/test-0003-object_space-object_and_content-original.expect +++ b/level_3/fss_read/tests/runtime/fss_0008/expect/test-0003-object_space-object_and_content-original.expect @@ -13,7 +13,7 @@ with content. } \# Valid Object { - \### Nested valud Object { + \### Nested valid Object { with nested content. } and outside. diff --git a/level_3/fss_read/tests/runtime/fss_0008/expect/test-0003-object_space-object_and_content-select-0-original.expect b/level_3/fss_read/tests/runtime/fss_0008/expect/test-0003-object_space-object_and_content-select-0-original.expect index e6327d9..04fbb74 100644 --- a/level_3/fss_read/tests/runtime/fss_0008/expect/test-0003-object_space-object_and_content-select-0-original.expect +++ b/level_3/fss_read/tests/runtime/fss_0008/expect/test-0003-object_space-object_and_content-select-0-original.expect @@ -13,7 +13,7 @@ with content. } \# Valid Object { - \### Nested valud Object { + \### Nested valid Object { with nested content. } and outside. diff --git a/level_3/fss_read/tests/runtime/fss_0008/expect/test-0003-object_space-object_and_content-select-0.expect b/level_3/fss_read/tests/runtime/fss_0008/expect/test-0003-object_space-object_and_content-select-0.expect index 3331b25..546e287 100644 --- a/level_3/fss_read/tests/runtime/fss_0008/expect/test-0003-object_space-object_and_content-select-0.expect +++ b/level_3/fss_read/tests/runtime/fss_0008/expect/test-0003-object_space-object_and_content-select-0.expect @@ -13,7 +13,7 @@ with content. } # Valid Object{ - \### Nested valud Object { + \### Nested valid Object { with nested content. } and outside. diff --git a/level_3/fss_read/tests/runtime/fss_0008/expect/test-0003-object_space-object_and_content-trim.expect b/level_3/fss_read/tests/runtime/fss_0008/expect/test-0003-object_space-object_and_content-trim.expect index 3331b25..546e287 100644 --- a/level_3/fss_read/tests/runtime/fss_0008/expect/test-0003-object_space-object_and_content-trim.expect +++ b/level_3/fss_read/tests/runtime/fss_0008/expect/test-0003-object_space-object_and_content-trim.expect @@ -13,7 +13,7 @@ with content. } # Valid Object{ - \### Nested valud Object { + \### Nested valid Object { with nested content. } and outside. diff --git a/level_3/fss_read/tests/runtime/fss_0008/expect/test-0003-object_space-object_and_content.expect b/level_3/fss_read/tests/runtime/fss_0008/expect/test-0003-object_space-object_and_content.expect index 3331b25..546e287 100644 --- a/level_3/fss_read/tests/runtime/fss_0008/expect/test-0003-object_space-object_and_content.expect +++ b/level_3/fss_read/tests/runtime/fss_0008/expect/test-0003-object_space-object_and_content.expect @@ -13,7 +13,7 @@ with content. } # Valid Object{ - \### Nested valud Object { + \### Nested valid Object { with nested content. } and outside. diff --git a/level_3/fss_read/tests/runtime/fss_0008/source/test-0003-object_space.fss b/level_3/fss_read/tests/runtime/fss_0008/source/test-0003-object_space.fss index 4303032..195235e 100644 --- a/level_3/fss_read/tests/runtime/fss_0008/source/test-0003-object_space.fss +++ b/level_3/fss_read/tests/runtime/fss_0008/source/test-0003-object_space.fss @@ -16,7 +16,7 @@ } \# Valid Object { - \### Nested valud Object { + \### Nested valid Object { with nested content. } and outside. -- 1.8.3.1