From a2941dee9ebc402247fe36cc5febf3947ca4b50a Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Tue, 18 Feb 2020 19:51:17 -0600 Subject: [PATCH] Update: add f_unterminated* status codes and fix f_unterminated_nest status codes Add basic f_unterminated status codes just like f_unterminated_group status codes. Fix missing status code conversions for f_unterminated_nest. --- level_0/f_status/c/status.h | 5 +++++ level_1/fl_status/c/status.c | 35 +++++++++++++++++++++++---------- level_1/fl_status/c/status.h | 35 +++++++++++++++++++++++---------- level_2/fll_status/c/status.c | 45 +++++++++++++++++++++++++++++++++---------- 4 files changed, 90 insertions(+), 30 deletions(-) diff --git a/level_0/f_status/c/status.h b/level_0/f_status/c/status.h index d1922b2..e3b57d4 100644 --- a/level_0/f_status/c/status.h +++ b/level_0/f_status/c/status.h @@ -234,6 +234,11 @@ extern "C" { f_no_data_on_stop, f_string_too_small, f_string_too_large, + f_unterminated, + f_unterminated_on_eof, + f_unterminated_on_eol, + f_unterminated_on_eos, + f_unterminated_on_stop, f_unterminated_group, f_unterminated_group_on_eof, f_unterminated_group_on_eol, diff --git a/level_1/fl_status/c/status.c b/level_1/fl_status/c/status.c index 68f9de8..5aef397 100644 --- a/level_1/fl_status/c/status.c +++ b/level_1/fl_status/c/status.c @@ -474,20 +474,20 @@ extern "C" { case f_string_too_large: *string = fl_status_string_string_too_large; break; - case f_unterminated_nest: - *string = fl_status_string_unterminated_nest; + case f_unterminated: + *string = fl_status_string_unterminated; break; - case f_unterminated_nest_on_eof: - *string = fl_status_string_unterminated_nest_on_eof; + case f_unterminated_on_eof: + *string = fl_status_string_unterminated_on_eof; break; - case f_unterminated_nest_on_eol: - *string = fl_status_string_unterminated_nest_on_eol; + case f_unterminated_on_eol: + *string = fl_status_string_unterminated_on_eol; break; - case f_unterminated_nest_on_eos: - *string = fl_status_string_unterminated_nest_on_eos; + case f_unterminated_on_eos: + *string = fl_status_string_unterminated_on_eos; break; - case f_unterminated_nest_on_stop: - *string = fl_status_string_unterminated_nest_on_stop; + case f_unterminated_on_stop: + *string = fl_status_string_unterminated_on_stop; break; case f_unterminated_group: *string = fl_status_string_unterminated_group; @@ -504,6 +504,21 @@ extern "C" { case f_unterminated_group_on_stop: *string = fl_status_string_unterminated_group_on_stop; break; + case f_unterminated_nest: + *string = fl_status_string_unterminated_nest; + break; + case f_unterminated_nest_on_eof: + *string = fl_status_string_unterminated_nest_on_eof; + break; + case f_unterminated_nest_on_eol: + *string = fl_status_string_unterminated_nest_on_eol; + break; + case f_unterminated_nest_on_eos: + *string = fl_status_string_unterminated_nest_on_eos; + break; + case f_unterminated_nest_on_stop: + *string = fl_status_string_unterminated_nest_on_stop; + break; case f_incomplete_utf: *string = fl_status_string_incomplete_utf; break; diff --git a/level_1/fl_status/c/status.h b/level_1/fl_status/c/status.h index ebe0813..0772713 100644 --- a/level_1/fl_status/c/status.h +++ b/level_1/fl_status/c/status.h @@ -477,20 +477,20 @@ extern "C" { #define fl_status_string_string_too_large "f_string_too_large" #define fl_status_string_string_too_large_length 19 - #define fl_status_string_unterminated_nest "f_unterminated_nest" - #define fl_status_string_unterminated_nest_length 20 + #define fl_status_string_unterminated "f_unterminated" + #define fl_status_string_unterminated_length 15 - #define fl_status_string_unterminated_nest_on_eof "f_unterminated_nest_on_eof" - #define fl_status_string_unterminated_nest_on_eof_length 27 + #define fl_status_string_unterminated_on_eof "f_unterminated_on_eof" + #define fl_status_string_unterminated_on_eof_length 22 - #define fl_status_string_unterminated_nest_on_eol "f_unterminated_nest_on_eol" - #define fl_status_string_unterminated_nest_on_eol_length 27 + #define fl_status_string_unterminated_on_eol "f_unterminated_on_eol" + #define fl_status_string_unterminated_on_eol_length 22 - #define fl_status_string_unterminated_nest_on_eos "f_unterminated_nest_on_eos" - #define fl_status_string_unterminated_nest_on_eos_length 27 + #define fl_status_string_unterminated_on_eos "f_unterminated_on_eos" + #define fl_status_string_unterminated_on_eos_length 22 - #define fl_status_string_unterminated_nest_on_stop "f_unterminated_nest_on_stop" - #define fl_status_string_unterminated_nest_on_stop_length 28 + #define fl_status_string_unterminated_on_stop "f_unterminated_on_stop" + #define fl_status_string_unterminated_on_stop_length 23 #define fl_status_string_unterminated_group "f_unterminated_group" #define fl_status_string_unterminated_group_length 21 @@ -507,6 +507,21 @@ extern "C" { #define fl_status_string_unterminated_group_on_stop "f_unterminated_group_on_stop" #define fl_status_string_unterminated_group_on_stop_length 29 + #define fl_status_string_unterminated_nest "f_unterminated_nest" + #define fl_status_string_unterminated_nest_length 20 + + #define fl_status_string_unterminated_nest_on_eof "f_unterminated_nest_on_eof" + #define fl_status_string_unterminated_nest_on_eof_length 27 + + #define fl_status_string_unterminated_nest_on_eol "f_unterminated_nest_on_eol" + #define fl_status_string_unterminated_nest_on_eol_length 27 + + #define fl_status_string_unterminated_nest_on_eos "f_unterminated_nest_on_eos" + #define fl_status_string_unterminated_nest_on_eos_length 27 + + #define fl_status_string_unterminated_nest_on_stop "f_unterminated_nest_on_stop" + #define fl_status_string_unterminated_nest_on_stop_length 28 + #define fl_status_string_incomplete_utf "f_incomplete_utf" #define fl_status_string_incomplete_utf_length 17 diff --git a/level_2/fll_status/c/status.c b/level_2/fll_status/c/status.c index 50246e2..2a7b8e9 100644 --- a/level_2/fll_status/c/status.c +++ b/level_2/fll_status/c/status.c @@ -776,28 +776,28 @@ extern "C" { return f_none; } - if (fl_string_compare(string, fl_status_string_unterminated_nest, length, fl_status_string_unterminated_nest_length) == f_equal_to) { - *code = f_unterminated_nest; + if (fl_string_compare(string, fl_status_string_unterminated, length, fl_status_string_unterminated_length) == f_equal_to) { + *code = f_unterminated; return f_none; } - if (fl_string_compare(string, fl_status_string_unterminated_nest_on_eof, length, fl_status_string_unterminated_nest_on_eof_length) == f_equal_to) { - *code = f_unterminated_nest_on_eof; + if (fl_string_compare(string, fl_status_string_unterminated_on_eof, length, fl_status_string_unterminated_on_eof_length) == f_equal_to) { + *code = f_unterminated_on_eof; return f_none; } - if (fl_string_compare(string, fl_status_string_unterminated_nest_on_eol, length, fl_status_string_unterminated_nest_on_eol_length) == f_equal_to) { - *code = f_unterminated_nest_on_eol; + if (fl_string_compare(string, fl_status_string_unterminated_on_eol, length, fl_status_string_unterminated_on_eol_length) == f_equal_to) { + *code = f_unterminated_on_eol; return f_none; } - if (fl_string_compare(string, fl_status_string_unterminated_nest_on_eos, length, fl_status_string_unterminated_nest_on_eos_length) == f_equal_to) { - *code = f_unterminated_nest_on_eos; + if (fl_string_compare(string, fl_status_string_unterminated_on_eos, length, fl_status_string_unterminated_on_eos_length) == f_equal_to) { + *code = f_unterminated_on_eos; return f_none; } - if (fl_string_compare(string, fl_status_string_unterminated_nest_on_stop, length, fl_status_string_unterminated_nest_on_stop_length) == f_equal_to) { - *code = f_unterminated_nest_on_stop; + if (fl_string_compare(string, fl_status_string_unterminated_on_stop, length, fl_status_string_unterminated_on_stop_length) == f_equal_to) { + *code = f_unterminated_on_stop; return f_none; } @@ -826,6 +826,31 @@ extern "C" { return f_none; } + if (fl_string_compare(string, fl_status_string_unterminated_nest, length, fl_status_string_unterminated_nest_length) == f_equal_to) { + *code = f_unterminated_nest; + return f_none; + } + + if (fl_string_compare(string, fl_status_string_unterminated_nest_on_eof, length, fl_status_string_unterminated_nest_on_eof_length) == f_equal_to) { + *code = f_unterminated_nest_on_eof; + return f_none; + } + + if (fl_string_compare(string, fl_status_string_unterminated_nest_on_eol, length, fl_status_string_unterminated_nest_on_eol_length) == f_equal_to) { + *code = f_unterminated_nest_on_eol; + return f_none; + } + + if (fl_string_compare(string, fl_status_string_unterminated_nest_on_eos, length, fl_status_string_unterminated_nest_on_eos_length) == f_equal_to) { + *code = f_unterminated_nest_on_eos; + return f_none; + } + + if (fl_string_compare(string, fl_status_string_unterminated_nest_on_stop, length, fl_status_string_unterminated_nest_on_stop_length) == f_equal_to) { + *code = f_unterminated_nest_on_stop; + return f_none; + } + if (fl_string_compare(string, fl_status_string_incomplete_utf, length, fl_status_string_incomplete_utf_length) == f_equal_to) { *code = f_incomplete_utf; return f_none; -- 1.8.3.1