From 2f7dd63c7464c20815f4edb62e523fc937a4c522 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Mon, 7 Jul 2025 01:13:06 +0200 Subject: [PATCH] code/awk --- readme.md | 1 - sh/{main.awk => code.awk} | 0 sh/code.sh | 18 +++++++++++++----- sh/main.sh | 4 +--- 4 files changed, 14 insertions(+), 9 deletions(-) rename sh/{main.awk => code.awk} (100%) diff --git a/readme.md b/readme.md index 437006d..db7e87d 100644 --- a/readme.md +++ b/readme.md @@ -117,7 +117,6 @@ Two interpreted languages for flexibility. * get unresolved path for new panes & windows * fully working doc function algorithm * self install aliases -* cache awk code * list aliases ### 6.2 [Further tasks](#when) {#when-further} diff --git a/sh/main.awk b/sh/code.awk similarity index 100% rename from sh/main.awk rename to sh/code.awk diff --git a/sh/code.sh b/sh/code.sh index c246878..2c4c5ed 100644 --- a/sh/code.sh +++ b/sh/code.sh @@ -1,10 +1,18 @@ -# code -# module - # ╭──────╮ # │ code │ # ╰──────╯ +# ╭──────┬───────────╮ +# │ code │ variables │ +# ╰──────┴───────────╯ + +# path to the required parsing awk script +_rwx_code_awk="$(cat "${RWX_ROOT_SYSTEM}/code.awk")" + +# ╭──────┬───────╮ +# │ code │ parts │ +# ╰──────┴───────╯ + # show the cached code #= rc rwx_code() { @@ -36,7 +44,7 @@ rwx_code_variables() { } # ╭──────┬───────╮ -# │ code │ check │ +# │ code │ parse │ # ╰──────┴───────╯ # check source code @@ -58,5 +66,5 @@ rwx_code_doc() { awk \ --assign action="doc" \ --assign target="${name}" \ - --file "${RWX_AWK}" + "${_rwx_code_awk}" } diff --git a/sh/main.sh b/sh/main.sh index 8cca344..f1be786 100755 --- a/sh/main.sh +++ b/sh/main.sh @@ -45,8 +45,6 @@ RWX_ROOT_SYSTEM="/usr/local/lib/${RWX_SELF_NAME}" # user root directory of the project RWX_SELF_USER="${HOME}/${RWX_SELF_NAME}" -# path to the required parsing awk script -RWX_AWK="${RWX_ROOT_SYSTEM}/${RWX_MAIN_NAME%.sh}.awk" # path to the entrypoint main file of the project RWX_MAIN_PATH="${RWX_ROOT_SYSTEM}/${RWX_MAIN_NAME}" @@ -225,7 +223,7 @@ rwx_parse_aliases_functions() { printf "%s" "${_rwx_code}" | awk \ --assign action="alias" \ - --file "${RWX_AWK}" + "${_rwx_code_awk}" } rwx_parse_constants() { printf "%s" "${_rwx_code}" |