From 3e7dbfa8bce33c77dca65ba288f3e0c926c4ce3b Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Sat, 3 Oct 2026 13:37:22 -0500 Subject: [PATCH] Progress: Update test file to be correct and remove some redundancy in the logic. The matches for extended list combining test should all be a 2. The `f_fss_is_combining_joiner()` already handles range and buffer checks and doesn't set error bit. This means those checks can be removed. --- level_1/fl_fss/c/fss/basic_list.c | 2 +- level_1/fl_fss/c/fss/extended_list.c | 4 +-- level_1/fl_fss/c/private-fss.c | 34 ++++++++----------- .../matches/extended_list-combining_read.txt | 4 +-- 4 files changed, 19 insertions(+), 25 deletions(-) diff --git a/level_1/fl_fss/c/fss/basic_list.c b/level_1/fl_fss/c/fss/basic_list.c index f592d4c23..195739e19 100644 --- a/level_1/fl_fss/c/fss/basic_list.c +++ b/level_1/fl_fss/c/fss/basic_list.c @@ -268,7 +268,7 @@ extern "C" { if ((flag_fl & ___fl_flag_has_graph_first___) && buffer.string[range->start] == f_fss_comment_s.string[0]) { previous = range->start++; - if (range->start <= range->stop && range->start < buffer.used && f_fss_is_combining_joiner(buffer, *range, state) == F_true) { + if (f_fss_is_combining_joiner(buffer, *range, state) == F_true) { flag_fl &= ~___fl_flag_has_graph_first_do_escape___; slash_count = 0; diff --git a/level_1/fl_fss/c/fss/extended_list.c b/level_1/fl_fss/c/fss/extended_list.c index 339518844..f6f3aefbb 100644 --- a/level_1/fl_fss/c/fss/extended_list.c +++ b/level_1/fl_fss/c/fss/extended_list.c @@ -147,7 +147,7 @@ extern "C" { else if (buffer.string[range->start] == f_fss_comment_s.string[0]) { previous = ++range->start; - if (range->start <= range->stop && range->start < buffer.used && f_fss_is_combining_joiner(buffer, *range, state) == F_true) { + if (f_fss_is_combining_joiner(buffer, *range, state) == F_true) { f_fss_skip_past_combining_joiner(buffer, range, state); if (F_status_is_error(state->status)) break; @@ -214,7 +214,7 @@ extern "C" { if (buffer.string[range->start] == f_fss_comment_s.string[0]) { previous = ++range->start; - if (range->start <= range->stop && range->start < buffer.used && f_fss_is_combining_joiner(buffer, *range, state) == F_true) { + if (f_fss_is_combining_joiner(buffer, *range, state) == F_true) { f_fss_skip_past_combining_joiner(buffer, range, state); if (F_status_is_error(state->status)) break; diff --git a/level_1/fl_fss/c/private-fss.c b/level_1/fl_fss/c/private-fss.c index 2b49539c4..c6b37e5c0 100644 --- a/level_1/fl_fss/c/private-fss.c +++ b/level_1/fl_fss/c/private-fss.c @@ -235,13 +235,11 @@ extern "C" { f_fss_skip_past_delimit(buffer, range, state); if (F_status_is_error(state->status)) return; - if (range->start <= range->stop && range->start < buffer.used) { - if (f_fss_is_combining_joiner(buffer, *range, state) == F_true) { - f_fss_skip_past_combining_joiner(buffer, range, state); - if (F_status_is_error(state->status)) return; + if (f_fss_is_combining_joiner(buffer, *range, state) == F_true) { + f_fss_skip_past_combining_joiner(buffer, range, state); + if (F_status_is_error(state->status)) return; - continue; - } + continue; } flag_fl &= ~___fl_flag_has_joiner_combining___; @@ -336,13 +334,11 @@ extern "C" { state->status = f_utf_buffer_increment(buffer, range, 1); if (F_status_is_error(state->status)) return; - if (range->start <= range->stop && range->start < buffer.used) { - if (f_fss_is_combining_joiner(buffer, *range, state) == F_true) { - flag_fl |= ___fl_flag_has_joiner_combining___; - } - else { - if (F_status_is_error(state->status)) return; - } + if (f_fss_is_combining_joiner(buffer, *range, state) == F_true) { + flag_fl |= ___fl_flag_has_joiner_combining___; + } + else { + if (F_status_is_error(state->status)) return; } // Designate that this is an appropriate space. @@ -517,13 +513,11 @@ extern "C" { state->status = f_utf_buffer_increment(buffer, range, 1); if (F_status_is_error(state->status)) return; - if (range->start <= range->stop && range->start < buffer.used) { - if (f_fss_is_combining_joiner(buffer, *range, state) == F_true) { - flag_fl |= ___fl_flag_has_joiner_combining___; - } - else { - if (F_status_is_error(state->status)) return; - } + if (f_fss_is_combining_joiner(buffer, *range, state) == F_true) { + flag_fl |= ___fl_flag_has_joiner_combining___; + } + else { + if (F_status_is_error(state->status)) return; } // Designate that this is an appropriate space. diff --git a/level_1/fl_fss/data/tests/matches/extended_list-combining_read.txt b/level_1/fl_fss/data/tests/matches/extended_list-combining_read.txt index 87000e719..5ee4e7592 100644 --- a/level_1/fl_fss/data/tests/matches/extended_list-combining_read.txt +++ b/level_1/fl_fss/data/tests/matches/extended_list-combining_read.txt @@ -1,6 +1,6 @@ 2 2 -1 -1 +2 +2 2 2 -- 2.52.0