From 686d04bd750a7bd6552b2ab1e74c01f2b5deafc8 Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Wed, 13 Jul 2022 07:07:45 -0500 Subject: [PATCH] Update: Replace Unicode Terminate escape sequence with Non-printing escape sequence. Use "\!" instead of "\U-". It is simpler and has the convenience of not being part of an IKI variable. Update the alphabetic ordering. The documentation is missing context IKI variable. Describe all supported context IKI variables. --- level_3/fake/c/private-common.c | 10 ++++----- level_3/fake/c/private-common.h | 30 +++++++++++++-------------- level_3/fake/c/private-make-operate.c | 20 +++++++++--------- level_3/fake/c/private-make-operate.h | 2 +- level_3/fake/c/private-make-operate_process.c | 7 +++---- level_3/fake/c/private-make-operate_process.h | 2 +- level_3/fake/documents/fakefile.txt | 17 ++++++++++++--- 7 files changed, 49 insertions(+), 39 deletions(-) diff --git a/level_3/fake/c/private-common.c b/level_3/fake/c/private-common.c index 4f64731..5042d4b 100644 --- a/level_3/fake/c/private-common.c +++ b/level_3/fake/c/private-common.c @@ -299,15 +299,15 @@ extern "C" { #endif // _di_fake_skeleton_content_ #ifndef _di_fake_make_context_ - const f_string_static_t fake_make_context_reset_s = macro_f_string_static_t_initialize(FAKE_make_context_reset_s, 0, FAKE_make_context_reset_s_length); - const f_string_static_t fake_make_context_warning_s = macro_f_string_static_t_initialize(FAKE_make_context_warning_s, 0, FAKE_make_context_warning_s_length); const f_string_static_t fake_make_context_error_s = macro_f_string_static_t_initialize(FAKE_make_context_error_s, 0, FAKE_make_context_error_s_length); - const f_string_static_t fake_make_context_title_s = macro_f_string_static_t_initialize(FAKE_make_context_title_s, 0, FAKE_make_context_title_s_length); - const f_string_static_t fake_make_context_notable_s = macro_f_string_static_t_initialize(FAKE_make_context_notable_s, 0, FAKE_make_context_notable_s_length); const f_string_static_t fake_make_context_important_s = macro_f_string_static_t_initialize(FAKE_make_context_important_s, 0, FAKE_make_context_important_s_length); + const f_string_static_t fake_make_context_normal_s = macro_f_string_static_t_initialize(FAKE_make_context_normal_s, 0, FAKE_make_context_normal_s_length); + const f_string_static_t fake_make_context_notable_s = macro_f_string_static_t_initialize(FAKE_make_context_notable_s, 0, FAKE_make_context_notable_s_length); + const f_string_static_t fake_make_context_reset_s = macro_f_string_static_t_initialize(FAKE_make_context_reset_s, 0, FAKE_make_context_reset_s_length); const f_string_static_t fake_make_context_standout_s = macro_f_string_static_t_initialize(FAKE_make_context_standout_s, 0, FAKE_make_context_standout_s_length); const f_string_static_t fake_make_context_success_s = macro_f_string_static_t_initialize(FAKE_make_context_success_s, 0, FAKE_make_context_success_s_length); - const f_string_static_t fake_make_context_normal_s = macro_f_string_static_t_initialize(FAKE_make_context_normal_s, 0, FAKE_make_context_normal_s_length); + const f_string_static_t fake_make_context_title_s = macro_f_string_static_t_initialize(FAKE_make_context_title_s, 0, FAKE_make_context_title_s_length); + const f_string_static_t fake_make_context_warning_s = macro_f_string_static_t_initialize(FAKE_make_context_warning_s, 0, FAKE_make_context_warning_s_length); #endif // _di_fake_make_context_ #ifndef _di_fake_file_data_build_strings_ diff --git a/level_3/fake/c/private-common.h b/level_3/fake/c/private-common.h index f710baf..cf1fcb2 100644 --- a/level_3/fake/c/private-common.h +++ b/level_3/fake/c/private-common.h @@ -1814,35 +1814,35 @@ extern "C" { #endif // _di_fake_skeleton_content_ #ifndef _di_fake_make_context_ - #define FAKE_make_context_reset_s "reset" - #define FAKE_make_context_warning_s "warning" #define FAKE_make_context_error_s "error" - #define FAKE_make_context_title_s "title" - #define FAKE_make_context_notable_s "notable" #define FAKE_make_context_important_s "important" + #define FAKE_make_context_normal_s "normal" + #define FAKE_make_context_notable_s "notable" + #define FAKE_make_context_reset_s "reset" #define FAKE_make_context_standout_s "standout" #define FAKE_make_context_success_s "success" - #define FAKE_make_context_normal_s "normal" + #define FAKE_make_context_title_s "title" + #define FAKE_make_context_warning_s "warning" - #define FAKE_make_context_reset_s_length 5 - #define FAKE_make_context_warning_s_length 7 #define FAKE_make_context_error_s_length 5 - #define FAKE_make_context_title_s_length 5 - #define FAKE_make_context_notable_s_length 7 #define FAKE_make_context_important_s_length 9 + #define FAKE_make_context_normal_s_length 6 + #define FAKE_make_context_notable_s_length 7 + #define FAKE_make_context_reset_s_length 5 #define FAKE_make_context_standout_s_length 8 #define FAKE_make_context_success_s_length 7 - #define FAKE_make_context_normal_s_length 5 + #define FAKE_make_context_title_s_length 5 + #define FAKE_make_context_warning_s_length 7 - extern const f_string_static_t fake_make_context_reset_s; - extern const f_string_static_t fake_make_context_warning_s; extern const f_string_static_t fake_make_context_error_s; - extern const f_string_static_t fake_make_context_title_s; - extern const f_string_static_t fake_make_context_notable_s; extern const f_string_static_t fake_make_context_important_s; + extern const f_string_static_t fake_make_context_normal_s; + extern const f_string_static_t fake_make_context_notable_s; + extern const f_string_static_t fake_make_context_reset_s; extern const f_string_static_t fake_make_context_standout_s; extern const f_string_static_t fake_make_context_success_s; - extern const f_string_static_t fake_make_context_normal_s; + extern const f_string_static_t fake_make_context_title_s; + extern const f_string_static_t fake_make_context_warning_s; #endif // _di_fake_make_context_ #ifndef _di_fake_file_data_build_strings_ diff --git a/level_3/fake/c/private-make-operate.c b/level_3/fake/c/private-make-operate.c index a1a96bd..d13296a 100644 --- a/level_3/fake/c/private-make-operate.c +++ b/level_3/fake/c/private-make-operate.c @@ -909,27 +909,27 @@ extern "C" { const f_string_static_t *context = 0; const f_string_static_t context_name[] = { - fake_make_context_reset_s, - fake_make_context_warning_s, fake_make_context_error_s, - fake_make_context_title_s, - fake_make_context_notable_s, fake_make_context_important_s, + fake_make_context_normal_s, + fake_make_context_notable_s, + fake_make_context_reset_s, fake_make_context_standout_s, fake_make_context_success_s, - fake_make_context_normal_s, + fake_make_context_title_s, + fake_make_context_warning_s, }; const f_color_set_t context_value[] = { - data_make->main->context.set.reset, - data_make->main->context.set.warning, data_make->main->context.set.error, - data_make->main->context.set.title, - data_make->main->context.set.notable, data_make->main->context.set.important, + data_make->main->context.set.normal, + data_make->main->context.set.notable, + data_make->main->context.set.reset, data_make->main->context.set.standout, data_make->main->context.set.success, - data_make->main->context.set.normal, + data_make->main->context.set.title, + data_make->main->context.set.warning, }; for (f_array_length_t i = 0; i < 9; ++i) { diff --git a/level_3/fake/c/private-make-operate.h b/level_3/fake/c/private-make-operate.h index 2f8654f..f04136c 100644 --- a/level_3/fake/c/private-make-operate.h +++ b/level_3/fake/c/private-make-operate.h @@ -155,7 +155,7 @@ extern "C" { * This generally is only needed when F_child is returned, where this holds the return status of the child process. */ #ifndef _di_fake_make_operate_section_ - int fake_make_operate_section(fake_make_data_t * const data_make, const f_array_length_t id_section, f_array_lengths_t *section_stack, f_status_t * const status) F_attribute_visibility_internal_d; + extern int fake_make_operate_section(fake_make_data_t * const data_make, const f_array_length_t id_section, f_array_lengths_t *section_stack, f_status_t * const status) F_attribute_visibility_internal_d; #endif // _di_fake_make_operate_section_ #ifdef __cplusplus diff --git a/level_3/fake/c/private-make-operate_process.c b/level_3/fake/c/private-make-operate_process.c index f669364..8c1fce9 100644 --- a/level_3/fake/c/private-make-operate_process.c +++ b/level_3/fake/c/private-make-operate_process.c @@ -488,6 +488,9 @@ extern "C" { else if (source.string[i] == f_string_ascii_0_s.string[0]) { destination->string[destination->used++] = f_string_null_s.string[0]; } + else if (source.string[i] == f_string_ascii_exclamation_s.string[0]) { + // The "\!" designates a do nothing character. + } else if (source.string[i] == f_string_ascii_U_s.string[0]) { // At the end of the string before a \U+XXXX sequence is completed is invalid. @@ -583,10 +586,6 @@ extern "C" { } } } - else if (source.string[i] == f_string_ascii_minus_s.string[0]) { - - // The "\U-" designates the termination of a Unicode sequence. - } else { // No plus found, so only the "\U" is considered invalid. diff --git a/level_3/fake/c/private-make-operate_process.h b/level_3/fake/c/private-make-operate_process.h index c885cab..4c57f02 100644 --- a/level_3/fake/c/private-make-operate_process.h +++ b/level_3/fake/c/private-make-operate_process.h @@ -52,7 +52,7 @@ extern "C" { * - "\\": Backslash Character (may require additional slashes in certain circumstances.) * - "\0": NULL Character. * - "\U+": Unicode Sequence (followed by a valid Unicode sequence with a minimum 4 hexidecimal digits and a maximum of 6 hexidecimal digits). - * - "\U-": Terminate a Unicode Sequence, allowing for "\U+000A\U-5" to be equivalent to "\n5". + * - "\!": Non-printing separator, allowing for "\U+000A\ 5" to be equivalent to "\n5". * * If the Unicode is invalid, then nothing is copied for that character (the invalid character is skipped when printing). * Example Unicodes\: diff --git a/level_3/fake/documents/fakefile.txt b/level_3/fake/documents/fakefile.txt index f21c8eb..7ceeffb 100644 --- a/level_3/fake/documents/fakefile.txt +++ b/level_3/fake/documents/fakefile.txt @@ -408,7 +408,7 @@ Fakefile Documentation: - "\\": Backslash Character (may require additional slashes in certain circumstances.) - "\0": NULL Character. - "\U+": Unicode Sequence (followed by a valid Unicode sequence with a minimum 4 hexidecimal digits and a maximum of 6 hexidecimal digits). - - "\U-": Terminate a Unicode Sequence, allowing for "\U+000A\U-5" to be equivalent to "\n5". + - "\!": Non-printing separator, allowing for "\U+000A\!5" to be equivalent to "\n5". If the Unicode is invalid, then nothing is printed for that character (the invalid character is skipped when printing). Example Unicodes\: @@ -486,7 +486,7 @@ Fakefile Documentation: - "\\": Backslash Character (may require additional slashes in certain circumstances.) - "\0": NULL Character. - "\U+": Unicode Sequence (followed by a valid Unicode sequence with a minimum 4 hexidecimal digits and a maximum of 6 hexidecimal digits). - - "\U-": Terminate a Unicode Sequence, allowing for "\U+000A\U-5" to be equivalent to "\n5". + - "\!": Non-printing separator, allowing for "\U+000A\!5" to be equivalent to "\n5". If the Unicode is invalid, then nothing is printed for that character (the invalid character is skipped when printing). Example Unicodes\: @@ -506,10 +506,21 @@ Fakefile Documentation: The use of IKI in this way is acceptable but it is not perfect. IKI is not designed to be a replacement to markup. The markup Example vs the IKI context:"notable" Example context:"notable" has obvious differences in the spaces. - The IKI by design cannot be used like this: context:"notable"Examplecontext:"notable". + The IKI by design cannot be used like this: context:"notable"Examplecontext:"notable" because the word "Example" and the word "context" collide. This context will respect the programs ++light, ++dark, and ++no_color parameters. + The following context are available\: + - error: Designate as an error, often printed in red. + - important: Designate as important. + - normal: Explicitly designate normal text. + - notable: Designate as notable (similar to "strong" or "bold" in HTML). + - reset: Remove the context. + - standout: Designate to make notable (similar to "italic" or "emphasis" in HTML). + - success: Designate as a success, often printed in bright green. + - title: Designate as a title. + - warning: Designate as a warning, often printed in some shade of orange. + - define\: The define Object represents environment variables passed to the program or created by the program. The value represents the environment variable name and is case-sensitive. -- 1.8.3.1