From: Kevin Day Date: Thu, 14 Jul 2022 02:05:08 +0000 (-0500) Subject: Update: Change "exists" to "exist" in fakefile syntax. X-Git-Tag: 0.6.0~56 X-Git-Url: https://git.kevux.org/?a=commitdiff_plain;h=c6394ce440357b2def6864f5d78fb66912286aa5;p=fll Update: Change "exists" to "exist" in fakefile syntax. The use of "exists" is grammatically correct and the use of "exist" is grammatically incorrect. This is not in English grammar. The practices of this project are to focus on using "s" strictly for plural. The practices of this project are to use simple or base words more often. The area in which proper grammar is allowed is when interacting with the user rather than with code. A project like Fake has a target user who is a programmer. This is a grey area. The project is already using "if define" rather than "if defined". For the purpose of keeping a consistent design, I am favoring "exist" over "exists" for this grey area. Another bonus is that "exist" is shorter than "exists" (however trivial). --- diff --git a/level_3/fake/c/private-common.c b/level_3/fake/c/private-common.c index 5042d4b..ab23574 100644 --- a/level_3/fake/c/private-common.c +++ b/level_3/fake/c/private-common.c @@ -229,7 +229,7 @@ extern "C" { const f_string_static_t fake_make_operation_argument_if_define_s = macro_f_string_static_t_initialize(FAKE_make_operation_argument_if_define_s, 0, FAKE_make_operation_argument_if_define_s_length); const f_string_static_t fake_make_operation_argument_if_equal_s = macro_f_string_static_t_initialize(FAKE_make_operation_argument_if_equal_s, 0, FAKE_make_operation_argument_if_equal_s_length); const f_string_static_t fake_make_operation_argument_if_equal_not_s = macro_f_string_static_t_initialize(FAKE_make_operation_argument_if_equal_not_s, 0, FAKE_make_operation_argument_if_equal_not_s_length); - const f_string_static_t fake_make_operation_argument_if_exists_s = macro_f_string_static_t_initialize(FAKE_make_operation_argument_if_exists_s, 0, FAKE_make_operation_argument_if_exists_s_length); + const f_string_static_t fake_make_operation_argument_if_exist_s = macro_f_string_static_t_initialize(FAKE_make_operation_argument_if_exist_s, 0, FAKE_make_operation_argument_if_exist_s_length); const f_string_static_t fake_make_operation_argument_if_failure_s = macro_f_string_static_t_initialize(FAKE_make_operation_argument_if_failure_s, 0, FAKE_make_operation_argument_if_failure_s_length); const f_string_static_t fake_make_operation_argument_if_greater_s = macro_f_string_static_t_initialize(FAKE_make_operation_argument_if_greater_s, 0, FAKE_make_operation_argument_if_greater_s_length); const f_string_static_t fake_make_operation_argument_if_greater_equal_s = macro_f_string_static_t_initialize(FAKE_make_operation_argument_if_greater_equal_s, 0, FAKE_make_operation_argument_if_greater_equal_s_length); diff --git a/level_3/fake/c/private-common.h b/level_3/fake/c/private-common.h index cf1fcb2..294ca74 100644 --- a/level_3/fake/c/private-common.h +++ b/level_3/fake/c/private-common.h @@ -1378,7 +1378,7 @@ extern "C" { #define FAKE_make_operation_argument_if_define_s "define" #define FAKE_make_operation_argument_if_equal_s "==" #define FAKE_make_operation_argument_if_equal_not_s "<>" - #define FAKE_make_operation_argument_if_exists_s "exists" + #define FAKE_make_operation_argument_if_exist_s "exist" #define FAKE_make_operation_argument_if_failure_s "failure" #define FAKE_make_operation_argument_if_greater_s ">" #define FAKE_make_operation_argument_if_greater_equal_s ">=" @@ -1396,7 +1396,7 @@ extern "C" { #define FAKE_make_operation_argument_if_define_s_length 6 #define FAKE_make_operation_argument_if_equal_s_length 2 #define FAKE_make_operation_argument_if_equal_not_s_length 2 - #define FAKE_make_operation_argument_if_exists_s_length 6 + #define FAKE_make_operation_argument_if_exist_s_length 5 #define FAKE_make_operation_argument_if_failure_s_length 7 #define FAKE_make_operation_argument_if_greater_s_length 1 #define FAKE_make_operation_argument_if_greater_equal_s_length 2 @@ -1414,7 +1414,7 @@ extern "C" { extern const f_string_static_t fake_make_operation_argument_if_define_s; extern const f_string_static_t fake_make_operation_argument_if_equal_s; extern const f_string_static_t fake_make_operation_argument_if_equal_not_s; - extern const f_string_static_t fake_make_operation_argument_if_exists_s; + extern const f_string_static_t fake_make_operation_argument_if_exist_s; extern const f_string_static_t fake_make_operation_argument_if_failure_s; extern const f_string_static_t fake_make_operation_argument_if_greater_s; extern const f_string_static_t fake_make_operation_argument_if_greater_equal_s; @@ -1435,7 +1435,7 @@ extern "C" { fake_make_operation_if_type_if_define_e, fake_make_operation_if_type_if_equal_e, fake_make_operation_if_type_if_equal_not_e, - fake_make_operation_if_type_if_exists_e, + fake_make_operation_if_type_if_exist_e, fake_make_operation_if_type_if_failure_e, fake_make_operation_if_type_if_greater_e, fake_make_operation_if_type_if_greater_equal_e, @@ -1446,7 +1446,7 @@ extern "C" { fake_make_operation_if_type_if_mode_e, fake_make_operation_if_type_if_not_e, fake_make_operation_if_type_if_not_define_e, - fake_make_operation_if_type_if_not_exists_e, + fake_make_operation_if_type_if_not_exist_e, fake_make_operation_if_type_if_not_group_e, fake_make_operation_if_type_if_not_is_e, fake_make_operation_if_type_if_not_mode_e, diff --git a/level_3/fake/c/private-make-operate_process.c b/level_3/fake/c/private-make-operate_process.c index 8c1fce9..7b7c81b 100644 --- a/level_3/fake/c/private-make-operate_process.c +++ b/level_3/fake/c/private-make-operate_process.c @@ -227,8 +227,8 @@ extern "C" { } // for } // for } - else if (state_process->condition == fake_make_operation_if_type_if_exists_e) { - *status = fake_make_operate_process_type_if_exists(data_make, arguments, F_false, state_process); + else if (state_process->condition == fake_make_operation_if_type_if_exist_e) { + *status = fake_make_operate_process_type_if_exist(data_make, arguments, F_false, state_process); } else if (state_process->condition == fake_make_operation_if_type_if_failure_e) { if (state_process->success) { @@ -256,8 +256,8 @@ extern "C" { else if (state_process->condition == fake_make_operation_if_type_if_not_parameter_e) { fake_make_operate_process_type_if_parameter(data_make, arguments, F_true, state_process); } - else if (state_process->condition == fake_make_operation_if_type_if_not_exists_e) { - *status = fake_make_operate_process_type_if_exists(data_make, arguments, F_true, state_process); + else if (state_process->condition == fake_make_operation_if_type_if_not_exist_e) { + *status = fake_make_operate_process_type_if_exist(data_make, arguments, F_true, state_process); } else if (state_process->condition == fake_make_operation_if_type_if_not_group_e) { *status = fake_make_operate_process_type_if_group(data_make, arguments, F_true, state_process); diff --git a/level_3/fake/c/private-make-operate_process_type.c b/level_3/fake/c/private-make-operate_process_type.c index c769eda..63227a3 100644 --- a/level_3/fake/c/private-make-operate_process_type.c +++ b/level_3/fake/c/private-make-operate_process_type.c @@ -355,8 +355,8 @@ extern "C" { } #endif // _di_fake_make_operate_process_type_if_define_ -#ifndef _di_fake_make_operate_process_type_if_exists_ - f_status_t fake_make_operate_process_type_if_exists(fake_make_data_t * const data_make, const f_string_dynamics_t arguments, const bool if_not, fake_state_process_t *state_process) { +#ifndef _di_fake_make_operate_process_type_if_exist_ + f_status_t fake_make_operate_process_type_if_exist(fake_make_data_t * const data_make, const f_string_dynamics_t arguments, const bool if_not, fake_state_process_t *state_process) { f_status_t status = F_none; f_array_length_t i = if_not ? 2 : 1; @@ -412,7 +412,7 @@ extern "C" { return F_none; } -#endif // _di_fake_make_operate_process_type_if_exists_ +#endif // _di_fake_make_operate_process_type_if_exist_ #ifndef _di_fake_make_operate_process_type_if_is_ f_status_t fake_make_operate_process_type_if_is(fake_make_data_t * const data_make, const f_string_dynamics_t arguments, const bool if_not, fake_state_process_t *state_process) { diff --git a/level_3/fake/c/private-make-operate_process_type.h b/level_3/fake/c/private-make-operate_process_type.h index 98676f7..2e6661e 100644 --- a/level_3/fake/c/private-make-operate_process_type.h +++ b/level_3/fake/c/private-make-operate_process_type.h @@ -149,9 +149,9 @@ extern "C" { * * @see f_file_exists() */ -#ifndef _di_fake_make_operate_process_type_if_exists_ - extern f_status_t fake_make_operate_process_type_if_exists(fake_make_data_t * const data_make, const f_string_dynamics_t arguments, const bool if_not, fake_state_process_t *state_process) F_attribute_visibility_internal_d; -#endif // _di_fake_make_operate_process_type_if_exists_ +#ifndef _di_fake_make_operate_process_type_if_exist_ + extern f_status_t fake_make_operate_process_type_if_exist(fake_make_data_t * const data_make, const f_string_dynamics_t arguments, const bool if_not, fake_state_process_t *state_process) F_attribute_visibility_internal_d; +#endif // _di_fake_make_operate_process_type_if_exist_ /** * Perform the if >, >=, <, and <= operation processes. diff --git a/level_3/fake/c/private-make-operate_validate.c b/level_3/fake/c/private-make-operate_validate.c index 39955e5..daf13a3 100644 --- a/level_3/fake/c/private-make-operate_validate.c +++ b/level_3/fake/c/private-make-operate_validate.c @@ -618,7 +618,7 @@ extern "C" { fake_make_operation_argument_if_define_s, fake_make_operation_argument_if_equal_s, fake_make_operation_argument_if_equal_not_s, - fake_make_operation_argument_if_exists_s, + fake_make_operation_argument_if_exist_s, fake_make_operation_argument_if_failure_s, fake_make_operation_argument_if_greater_s, fake_make_operation_argument_if_greater_equal_s, @@ -629,7 +629,7 @@ extern "C" { fake_make_operation_argument_if_mode_s, fake_make_operation_argument_if_not_s, fake_make_operation_argument_if_define_s, // If not define, represented by just "define". - fake_make_operation_argument_if_exists_s, // If not exists, represented by just "exists". + fake_make_operation_argument_if_exist_s, // If not exist, represented by just "exist". fake_make_operation_argument_if_group_s, // If not group, represented by just "group". fake_make_operation_argument_if_is_s, // If not is, represented by just "is". fake_make_operation_argument_if_mode_s, // If not mode, represented by just "mode". @@ -644,7 +644,7 @@ extern "C" { fake_make_operation_if_type_if_define_e, fake_make_operation_if_type_if_equal_e, fake_make_operation_if_type_if_equal_not_e, - fake_make_operation_if_type_if_exists_e, + fake_make_operation_if_type_if_exist_e, fake_make_operation_if_type_if_failure_e, fake_make_operation_if_type_if_greater_e, fake_make_operation_if_type_if_greater_equal_e, @@ -655,7 +655,7 @@ extern "C" { fake_make_operation_if_type_if_mode_e, fake_make_operation_if_type_if_not_e, fake_make_operation_if_type_if_not_define_e, - fake_make_operation_if_type_if_not_exists_e, + fake_make_operation_if_type_if_not_exist_e, fake_make_operation_if_type_if_not_group_e, fake_make_operation_if_type_if_not_is_e, fake_make_operation_if_type_if_not_mode_e, @@ -668,7 +668,7 @@ extern "C" { const f_string_static_t if_not_type_strings[] = { fake_make_operation_argument_if_define_s, - fake_make_operation_argument_if_exists_s, + fake_make_operation_argument_if_exist_s, fake_make_operation_argument_if_group_s, fake_make_operation_argument_if_is_s, fake_make_operation_argument_if_mode_s, @@ -678,7 +678,7 @@ extern "C" { const uint8_t if_not_type_codes[] = { fake_make_operation_if_type_if_not_define_e, - fake_make_operation_if_type_if_not_exists_e, + fake_make_operation_if_type_if_not_exist_e, fake_make_operation_if_type_if_not_group_e, fake_make_operation_if_type_if_not_is_e, fake_make_operation_if_type_if_not_mode_e, @@ -711,7 +711,7 @@ extern "C" { dereference ? 3 : 4, // If define. dereference ? 2 : 3, // If equal (==). dereference ? 2 : 3, // If equal not (<>). - dereference ? 2 : 3, // If exists. + dereference ? 2 : 3, // If exist. dereference ? 1 : 2, // If failure. dereference ? 2 : 3, // If greater (>). dereference ? 2 : 3, // If greater equal (>=). @@ -722,7 +722,7 @@ extern "C" { dereference ? 4 : 5, // If mode. dereference ? 3 : 4, // If not. dereference ? 5 : 6, // If not define. - dereference ? 3 : 4, // If not exists. + dereference ? 3 : 4, // If not exist. dereference ? 4 : 5, // If not group. dereference ? 4 : 5, // If not is. dereference ? 5 : 6, // If not mode. @@ -735,7 +735,7 @@ extern "C" { const uint8_t if_not_type_minimum[] = { dereference ? 4 : 5, // If not define. - dereference ? 3 : 4, // If not exists. + dereference ? 3 : 4, // If not exist. dereference ? 4 : 5, // If not group. dereference ? 4 : 5, // If not is. dereference ? 5 : 6, // If not mode. @@ -841,11 +841,11 @@ extern "C" { return; } - if (state_process->condition == fake_make_operation_if_type_if_exists_e || state_process->condition == fake_make_operation_if_type_if_not_exists_e) { + if (state_process->condition == fake_make_operation_if_type_if_exist_e || state_process->condition == fake_make_operation_if_type_if_not_exist_e) { return; } - if (state_process->condition == fake_make_operation_if_type_if_group_e || state_process->condition == fake_make_operation_if_type_if_is_e || state_process->condition == fake_make_operation_if_type_if_mode_e || state_process->condition > fake_make_operation_if_type_if_not_exists_e && state_process->condition < fake_make_operation_if_type_if_success_e) { + if (state_process->condition == fake_make_operation_if_type_if_group_e || state_process->condition == fake_make_operation_if_type_if_is_e || state_process->condition == fake_make_operation_if_type_if_mode_e || state_process->condition > fake_make_operation_if_type_if_not_exist_e && state_process->condition < fake_make_operation_if_type_if_success_e) { if (state_process->condition == fake_make_operation_if_type_if_mode_e || state_process->condition == fake_make_operation_if_type_if_not_mode_e) { if (fl_string_dynamic_compare(fake_make_operation_argument_is_s, arguments.array[k]) == F_equal_to_not) { if (fl_string_dynamic_compare(fake_make_operation_argument_has_s, arguments.array[k]) == F_equal_to_not) { @@ -965,7 +965,7 @@ extern "C" { } } } - else if (state_process->condition != fake_make_operation_if_type_if_exists_e && state_process->condition != fake_make_operation_if_type_if_is_e) { + else if (state_process->condition != fake_make_operation_if_type_if_exist_e && state_process->condition != fake_make_operation_if_type_if_is_e) { // The existence tests do not need to happen here for *_if_exists and *_if_is as those two types will handle performing them during the process stage. status_file = f_file_exists(arguments.array[i], dereference); diff --git a/level_3/fake/documents/fakefile.txt b/level_3/fake/documents/fakefile.txt index 7ceeffb..b10ee07 100644 --- a/level_3/fake/documents/fakefile.txt +++ b/level_3/fake/documents/fakefile.txt @@ -253,9 +253,9 @@ Fakefile Documentation: Test if one or more names are defined as an environment variable. For example, "if define PWD SHELL" would test if both the "PWD" and the "SHELL" variables are defined via the environment variables. - - exists "file path"\: + - exist "file path"\: Test if file exists. - For example, "if exists "a.txt" "b.txt" would test if both the file a.txt and b.txt exist. + For example, "if exist "a.txt" "b.txt" would test if both the file a.txt and b.txt exist. - failure\: Test if the previous section operation failed. @@ -279,7 +279,7 @@ Fakefile Documentation: Only the following if conditions are supported\: - define. - - exists. + - exist. - group. - is. - mode. @@ -288,7 +288,7 @@ Fakefile Documentation: Examples\: - "if not parameter work" - - "if not exists documentation.txt" + - "if not exist documentation.txt" - owner "some mode" "some file"\: Test if one or more files has the given owner. @@ -594,7 +594,7 @@ Fakefile Documentation: The default behavior is normally to dereference the link target. For example, consider a symbolic link, called "some_file", that points to a file that does not exist (which means that the link in question is a broken link). - The Operation "if exists some_file" would return false. - The Operation "if no_dereference exists some_file" would return true. + The Operation "if exist some_file" would return false. + The Operation "if no_dereference exist some_file" would return true. This is because the symbolic link itself, "some_file", does exist but the file it is pointing to does not. The "no_dereference" is ignored for conditions that do not need it. diff --git a/level_3/fake/specifications/fakefile.txt b/level_3/fake/specifications/fakefile.txt index 0669089..40d06ae 100644 --- a/level_3/fake/specifications/fakefile.txt +++ b/level_3/fake/specifications/fakefile.txt @@ -86,13 +86,13 @@ Fakefile Specification: - <=: Two or more Content. - <>: Two or more Content. - define: One or more Content are valid environment variable name. - - exists: One or more Content representing the files to check the existence of. + - exist: One or more Content representing the files to check the existence of. - failure: has no other Content. - group: First Content is the name of a group. Second or more Content are paths to files. - is: First Content is a list of "block", "character", "no_dereference", "directory", "fifo", "link", "regular" , or "socket" followed by "for" and then the Remaining Content that are paths to files. - mode: First Content is either "has", "is", or "no_dereference". Second Content is a valid file mode. Third or more Content are paths to files. - - no_dereference: A non-condition inserted before any of "exists", "is", and "mode" (then the second Content is the actual condition followed by any Content associated with that condition). - - not: First Content is one of "define", "exists", "group", "is", "mode", "no_dereference", "owner", or "parameter" and all remaining Content are based on the First Content's "if" Section Operation Content rules. + - no_dereference: A non-condition inserted before any of "exist", "is", and "mode" (then the second Content is the actual condition followed by any Content associated with that condition). + - not: First Content is one of "define", "exist", "group", "is", "mode", "no_dereference", "owner", or "parameter" and all remaining Content are based on the First Content's "if" Section Operation Content rules. - owner: First Content is the name of an owner. Second or more Content are paths to files. - parameter: One or more Content are valid IKI names. - success: has no other Content.