f_array_length_t start = 0;
f_array_length_t comment_delimit = 0;
- uint8_t graph_first = 0x1; // 0x0 = false, 0x1 = true, 0x2 = false, but there is a delimited comment, comment_delimit is set.
+ // 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;
// Identify where the content ends.
while (range->start <= range->stop && range->start < buffer.used) {
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 = 0x0;
+ uint8_t graph_first = 0x1;
// Initialize depth 1 start position.
// Positions_start.used is used as a max depth (such that positions_start.used == max depth + 1).
}
}
else if (graph_first == 0x1 && buffer.string[range->start] == f_fss_comment_s.string[0]) {
- position = newline_last + 1;
+ position = line_start;
status = f_fss_seek_to_eol(state, buffer, range);
if (F_status_is_error(status)) break;
--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;
+
comments->array[comments->used].start = position;
comments->array[comments->used++].stop = range->start++;
+ line_start = range->start;
continue;
}
f_array_length_t slash_first = 0;
f_array_length_t slash_count = 0;
- bool graph_first = F_true;
+ // 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]) {
for (; i < comments->used; ++i) {
for (j = comments->array[i].start; j <= comments->array[i].stop; ++j) {
- data->buffer.string[j] = f_fss_delimit_placeholder_s.string[0];
+
+ if (j < data->buffer.used) {
+ data->buffer.string[j] = f_fss_delimit_placeholder_s.string[0];
+ }
} // for
} // for
}