]> Kevux Git Server - fll/commitdiff
Progress: use the content_nests equivalents in place of the contents
authorKevin Day <thekevinday@gmail.com>
Sat, 2 Nov 2019 20:05:07 +0000 (15:05 -0500)
committerKevin Day <thekevinday@gmail.com>
Sat, 2 Nov 2019 20:05:16 +0000 (15:05 -0500)
When I copied basic_list code to use a starting point for extended, I missed creating "nest" equivalents to some code.

level_1/fl_fss/c/fss_extended_list.c
level_1/fl_fss/c/fss_macro.h
level_3/fss_extended_list_read/c/fss_extended_list_read.c

index 04fec73058a8317c313de5e27a93348f85a64d0f..adeb5d842544eb8186fadc4eb74187cd6e9ec4f8 100644 (file)
@@ -203,7 +203,7 @@ extern "C" {
     fl_macro_fss_skip_past_delimit_placeholders((*buffer), (*location))
     fl_macro_fss_content_nest_return_on_overflow((*buffer), (*location), (*found), positions_start, delimits, f_none_on_eos, f_none_on_stop)
 
-    fl_macro_fss_allocate_content_if_necessary((*found), delimits);
+    fl_macro_fss_allocate_content_nest_if_necessary((*found), delimits);
 
     f_array_length depth = 0;
     f_string_length position_previous = location->start;
index ee9305866c958b0ade45c750ba112afcb03315a3..8574123211dc7525fdfd661ecd9e9798e3659db4 100644 (file)
@@ -137,6 +137,21 @@ extern "C" {
     }
 #endif // _di_fl_macro_fss_content_delimited_return_on_overflow_
 
+#ifndef _di_fl_macro_fss_allocate_content_if_necessary_
+  #define fl_macro_fss_allocate_content_if_necessary(content, delimits) \
+    if (content.used >= content.size) { \
+      f_status status = f_none; \
+      \
+      f_macro_fss_content_resize(status, content, content.size + f_fss_default_allocation_step); \
+      if (f_status_is_error(status)) { \
+        f_status macro_allocation_status = f_none; \
+        f_macro_string_lengths_delete(macro_allocation_status, delimits); \
+        \
+        return status; \
+      } \
+    }
+#endif // _di_fl_macro_fss_allocate_content_if_necessary_
+
 #ifndef _di_fl_macro_fss_content_nest_return_on_overflow_
   #define fl_macro_fss_content_nest_return_on_overflow(buffer, location, found, delimits, positions, eos_status, stop_status) \
     if (location.start >= buffer.used) { \
@@ -188,12 +203,12 @@ extern "C" {
     // @todo: found.array[found.used].stop = location.stop;
 #endif // _di_fl_macro_fss_content_nest_delimited_return_on_overflow_
 
-#ifndef _di_fl_macro_fss_allocate_content_if_necessary_
-  #define fl_macro_fss_allocate_content_if_necessary(content, delimits) \
+#ifndef _di_fl_macro_fss_allocate_content_nest_if_necessary_
+  #define fl_macro_fss_allocate_content_nest_if_necessary(content, delimits) \
     if (content.used >= content.size) { \
       f_status status = f_none; \
       \
-      f_macro_fss_content_resize(status, content, content.size + f_fss_default_allocation_step); \
+      f_macro_fss_content_nest_resize(status, content, content.size + f_fss_default_allocation_step); \
       if (f_status_is_error(status)) { \
         f_status macro_allocation_status = f_none; \
         f_macro_string_lengths_delete(macro_allocation_status, delimits); \
@@ -201,7 +216,7 @@ extern "C" {
         return status; \
       } \
     }
-#endif // _di_fl_macro_fss_allocate_content_if_necessary_
+#endif // _di_fl_macro_fss_allocate_content_nest_if_necessary_
 
 #ifndef _di_fl_macro_fss_object_seek_till_newline_
   #define fl_macro_fss_object_seek_till_newline(buffer, location, delimits, eos_status, stop_status) \
index e669fa15d023aed5733575cdd853190e7f18b9a9..62f29a3b4df9457ffd49b6b63c672b51fe9af5c3 100644 (file)
@@ -192,7 +192,7 @@ extern "C" {
         }
 
         // clear buffers before repeating the loop
-        f_macro_fss_contents_delete(status2, data->contents);
+        f_macro_fss_content_nests_delete(status2, data->contents);
         f_macro_fss_objects_delete(status2, data->objects);
         f_macro_string_dynamic_delete(status2, data->buffer);
       } // for
@@ -217,7 +217,7 @@ extern "C" {
       i++;
     } // while
 
-    f_macro_fss_contents_delete(status, data->contents);
+    f_macro_fss_content_nests_delete(status, data->contents);
     f_macro_fss_objects_delete(status, data->objects);
     f_macro_string_dynamic_delete(status, data->buffer);
     f_macro_string_lengths_delete(status, data->remaining);