From: Kevin Day Date: Mon, 27 Jul 2026 23:57:46 +0000 (-0500) Subject: Progress: Latest changes. X-Git-Url: https://www.git.kevux.org/?a=commitdiff_plain;h=785b4c370f27e47792195dfaca5fa78a701cb339;p=fll Progress: Latest changes. --- diff --git a/level_1/fl_fss/c/fss/embedded_list.c b/level_1/fl_fss/c/fss/embedded_list.c index b7f3acadc..78ceb3a16 100644 --- a/level_1/fl_fss/c/fss/embedded_list.c +++ b/level_1/fl_fss/c/fss/embedded_list.c @@ -983,6 +983,7 @@ extern "C" { state->status = f_memory_array_increase_by(4, sizeof(f_char_t), (void **) &destination->string, &destination->used, &destination->size); if (F_status_is_error(state->status)) return; + #define ___fl_flag_ends_on_space___ 0x1 #define ___fl_flag_has_graph___ 0x2 #define ___fl_flag_is_comment___ 0x4 #define ___fl_flag_is_combining___ 0x8 @@ -997,8 +998,7 @@ extern "C" { f_number_unsigned_t previous = 0; f_number_unsigned_t slash_count = 0; - uint8_t flag = 0; - uint8_t ends_on_space = F_false; + uint8_t flag = 0x0; uint8_t width = 0; // Find the first graph character. @@ -1159,7 +1159,7 @@ extern "C" { } // while if (range->start > range->stop || range->start >= object.used) { - ends_on_space = F_false; + flag &= ~___fl_flag_ends_on_space___; break; } @@ -1176,7 +1176,7 @@ extern "C" { if (F_status_is_error(state->status)) break; } else { - ends_on_space = F_true; + flag |= ___fl_flag_ends_on_space___; if (object.string[range->start] == f_fss_eol_s.string[0]) { state->status = F_status_set_error(F_okay_eol); @@ -1216,7 +1216,7 @@ extern "C" { } // Prevent a space from being added post-trimming. - ends_on_space = F_true; + flag |= ___fl_flag_ends_on_space___; } if (complete != f_fss_complete_trim_e) { @@ -1228,7 +1228,7 @@ extern "C" { return; } - if (!ends_on_space) { + if (!(flag & ___fl_flag_ends_on_space___)) { destination->string[destination->used++] = f_fss_space_s.string[0]; } @@ -1250,6 +1250,7 @@ extern "C" { state->status = F_okay; } + #undef ___fl_flag_ends_on_space___ #undef ___fl_flag_has_graph___ #undef ___fl_flag_is_comment___ #undef ___fl_flag_is_combining___ diff --git a/level_1/fl_fss/c/fss/extended_list.c b/level_1/fl_fss/c/fss/extended_list.c index 957a31cf9..c94f2d42c 100644 --- a/level_1/fl_fss/c/fss/extended_list.c +++ b/level_1/fl_fss/c/fss/extended_list.c @@ -667,6 +667,7 @@ extern "C" { state->status = f_memory_array_increase_by(4, sizeof(f_char_t), (void **) &destination->string, &destination->used, &destination->size); if (F_status_is_error(state->status)) return; + #define ___fl_flag_ends_on_space___ 0x1 #define ___fl_flag_has_eol___ 0x2 #define ___fl_flag_has_eol_do_prepend___ 0x3 #define ___fl_flag_has_graph___ 0x4 @@ -684,8 +685,7 @@ extern "C" { f_number_unsigned_t previous = 0; f_number_unsigned_t slash_count = 0; - uint8_t flag = 0; - uint8_t ends_on_space = F_false; + uint8_t flag = 0x0; uint8_t width = 0; // Find the first graph character. @@ -846,7 +846,7 @@ extern "C" { } // while if (range->start > range->stop || range->start >= object.used) { - ends_on_space = F_false; + flag &= ~___fl_flag_ends_on_space___; break; } @@ -863,7 +863,7 @@ extern "C" { if (F_status_is_error(state->status)) break; } else { - ends_on_space = F_true; + flag |= ___fl_flag_ends_on_space___; if (object.string[range->start] == f_fss_eol_s.string[0]) { state->status = F_status_set_error(F_okay_eol); @@ -903,7 +903,7 @@ extern "C" { } // Prevent a space from being added post-trimming. - ends_on_space = F_true; + flag |= ___fl_flag_ends_on_space___; } if (complete != f_fss_complete_trim_e) { @@ -915,7 +915,7 @@ extern "C" { return; } - if (!ends_on_space) { + if (!(flag & ___fl_flag_ends_on_space___)) { destination->string[destination->used++] = f_fss_space_s.string[0]; } @@ -937,6 +937,7 @@ extern "C" { state->status = F_okay; } + #undef ___fl_flag_ends_on_space___ #undef ___fl_flag_has_eol___ #undef ___fl_flag_has_eol_do_prepend___ #undef ___fl_flag_has_graph___ diff --git a/level_1/fl_fss/c/private-fss.c b/level_1/fl_fss/c/private-fss.c index 61c362f41..6fcf1588f 100644 --- a/level_1/fl_fss/c/private-fss.c +++ b/level_1/fl_fss/c/private-fss.c @@ -26,10 +26,18 @@ extern "C" { return; } - const f_number_unsigned_t delimits_used = delimits->used; - const f_number_unsigned_t begin = range->start; + #define ___fl_flag_do_escape___ 0x40 + #define ___fl_flag_do_prepend___ 0x1 + #define ___fl_flag_has_graph___ 0x2 + #define ___fl_flag_is_comment___ 0x4 + #define ___fl_flag_is_combining___ 0x8 + #define ___fl_flag_is_combining_graph___ 0xa + #define ___fl_flag_is_joined___ 0x10 + #define ___fl_flag_is_joiner___ 0x20 + #define ___fl_flag_is_joiner_graph___ 0x22 + #define ___fl_flag_is_joinerd___ 0x30 - f_number_unsigned_t previous = 0; + const f_number_unsigned_t begin = range->start; found->start = begin; @@ -72,18 +80,41 @@ extern "C" { range->start = begin; } + const f_number_unsigned_t delimits_used = delimits->used; + + f_number_unsigned_t first_slash = 0; + f_number_unsigned_t location = 0; + f_number_unsigned_t previous = 0; + f_number_unsigned_t slash_count = 0; + + uint8_t flag_fl = 0x0; f_char_t quote_found = 0; if (quote) *quote = f_fss_quote_type_none_e; // Identify where the object begins. if (buffer.string[range->start] == f_fss_slash_s.string[0]) { - f_number_unsigned_t first_slash = found->start = range->start; + first_slash = found->start = range->start; + flag_fl |= ___fl_flag_do_escape___; state->status = f_utf_buffer_increment(buffer, range, 1); + if (state->status == F_okay) { + f_fss_skip_past_delimit(buffer, range, state); + } + + // If first slash has a combining/joiner following it, then there is no escaping at all so first_slash is the start of an object and is not considered an escaping character. if (F_status_is_error_not(state->status)) { - while (range->start <= range->stop && range->start < buffer.used) { + if (f_fss_is_combining_joiner(buffer, *range, state) != F_false) { + range->start = first_slash; + flag_fl &= ~___fl_flag_do_escape___; + } + } + + if (F_status_is_error(state->status)) return; + + if (flag_fl & ___fl_flag_do_escape___) { + while (F_status_is_error_not(state->status) && range->start <= range->stop && range->start < buffer.used) { if (state->interrupt) { state->interrupt((void *) state, 0); @@ -92,7 +123,6 @@ extern "C" { if (buffer.string[range->start] == f_fss_placeholder_s.string[0]) { state->status = f_utf_buffer_increment(buffer, range, 1); - if (F_status_is_error(state->status)) return; continue; } @@ -133,8 +163,11 @@ extern "C" { } state->status = f_utf_buffer_increment(buffer, range, 1); - if (F_status_is_error(state->status)) return; } // while + + if (F_status_is_error(state->status)) return; + + flag_fl &= ~___fl_flag_do_escape___; } if (range->start >= buffer.used) { @@ -169,9 +202,9 @@ extern "C" { // Identify where the object ends. if (quote_found) { - f_number_unsigned_t first_slash = 0; - f_number_unsigned_t slash_count = 0; - f_number_unsigned_t location = 0; + first_slash = 0; + slash_count = 0; + location = 0; while (range->start <= range->stop && range->start < buffer.used) { @@ -691,6 +724,17 @@ extern "C" { ++range->start; state->status = F_fss_found_object_not; + + #undef ___fl_flag_do_escape___ + #undef ___fl_flag_do_prepend___ + #undef ___fl_flag_has_graph___ + #undef ___fl_flag_is_comment___ + #undef ___fl_flag_is_combining___ + #undef ___fl_flag_is_combining_graph___ + #undef ___fl_flag_is_joined___ + #undef ___fl_flag_is_joiner___ + #undef ___fl_flag_is_joiner_graph___ + #undef ___fl_flag_is_joinerd___ } #endif // !defined(_di_fl_fss_basic_object_read_) || !defined(_di_fl_fss_extended_object_read_) diff --git a/specifications/fss.txt b/specifications/fss.txt index b714e36a0..48a7b6501 100644 --- a/specifications/fss.txt +++ b/specifications/fss.txt @@ -1,7 +1,7 @@ # fss-0002 iki-0000 # # license open-standard-license-1.0-or-later -# version 2026/06/27 +# version 2026/07/21 # # This file (assumed to be named fss.txt) can be more easily read using the following iki_read commands: # iki_read fss.txt +Q -w -rrrrrrrr anti-KISS anti-KISS ASCII ASCII BOM BOM FSS FSS KISS KISS UTF-8 UTF-8 URL URL XML XML -WWW character "'" "'" code '"' '"' italic '"' '"' @@ -80,6 +80,7 @@ Featureless Settings Specifications: "Object 1\\" has content starting at the 'has', with an Object named "Object 1\". Unless otherwise specified, quotes with combining or joining characters are not to be considered a quote for these purposes. + Unless otherwise specified, escaping characters with combining or joining characters are not to be considered a escaping characters for these purposes. Unless otherwise specified, character/data delimits are performed only when required and not unilaterally. In the case of Objects, delimits would only apply when that Object could be potentially identified as an Object.