From e4687e788baf95b580c7c1a51785e4a0bc9a9239 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Mon, 7 Jul 2025 01:34:22 +0200 Subject: [PATCH 1/7] code/awk --- sh/code.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sh/code.sh b/sh/code.sh index 2c4c5ed..0875682 100644 --- a/sh/code.sh +++ b/sh/code.sh @@ -25,6 +25,11 @@ rwx_code_aliases_functions() { echo "${_rwx_code_aliases_functions}" } +# show the cached awk script +rwx_code_awk() { + echo "${_rwx_code_awk}" +} + # show the cached constants #= rcc rwx_code_constants() { From 297b3a3385c6f1f204c28624b82a78f0376d0995 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Mon, 7 Jul 2025 01:37:54 +0200 Subject: [PATCH 2/7] code/awk --- sh/code.sh | 2 +- sh/main.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sh/code.sh b/sh/code.sh index 0875682..fe73c91 100644 --- a/sh/code.sh +++ b/sh/code.sh @@ -71,5 +71,5 @@ rwx_code_doc() { awk \ --assign action="doc" \ --assign target="${name}" \ - "${_rwx_code_awk}" + "$(rwx_code_awk)" } diff --git a/sh/main.sh b/sh/main.sh index f1be786..871bf05 100755 --- a/sh/main.sh +++ b/sh/main.sh @@ -223,7 +223,7 @@ rwx_parse_aliases_functions() { printf "%s" "${_rwx_code}" | awk \ --assign action="alias" \ - "${_rwx_code_awk}" + "$(rwx_code_awk)" } rwx_parse_constants() { printf "%s" "${_rwx_code}" | From 3e07b468d1f8787a783914ac519cdb0d15a7a040 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Mon, 7 Jul 2025 01:44:29 +0200 Subject: [PATCH 3/7] readme/task --- readme.md | 1 + 1 file changed, 1 insertion(+) diff --git a/readme.md b/readme.md index db7e87d..95fc211 100644 --- a/readme.md +++ b/readme.md @@ -118,5 +118,6 @@ Two interpreted languages for flexibility. * fully working doc function algorithm * self install aliases * list aliases +* transfer all parsings to awk ### 6.2 [Further tasks](#when) {#when-further} From 6130f15fec9aafe2194d8e44ade2daa5c7201cef Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Mon, 7 Jul 2025 01:47:07 +0200 Subject: [PATCH 4/7] aliases functions --- sh/code.awk | 2 +- sh/main.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sh/code.awk b/sh/code.awk index b8a8f59..33684e5 100644 --- a/sh/code.awk +++ b/sh/code.awk @@ -46,7 +46,7 @@ BEGIN { } { - if (action == "alias") { + if (action == "aliases functions") { if (match($0, RE_ALIAS, m)) { append(m[1]) } else if (match($0, RE_FUNCTION, m)) { diff --git a/sh/main.sh b/sh/main.sh index 871bf05..4ccb70b 100755 --- a/sh/main.sh +++ b/sh/main.sh @@ -222,7 +222,7 @@ EOF rwx_parse_aliases_functions() { printf "%s" "${_rwx_code}" | awk \ - --assign action="alias" \ + --assign action="aliases functions" \ "$(rwx_code_awk)" } rwx_parse_constants() { From ec8b41401889e4f4568d3d4befe4bc9c0ffbd40c Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Mon, 7 Jul 2025 02:10:05 +0200 Subject: [PATCH 5/7] code/aliases --- readme.md | 1 - sh/code.awk | 6 +++++- sh/main.sh | 10 +++++++++- sh/test.sh | 2 +- 4 files changed, 15 insertions(+), 4 deletions(-) diff --git a/readme.md b/readme.md index 95fc211..9a09ee7 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 -* list aliases * transfer all parsings to awk ### 6.2 [Further tasks](#when) {#when-further} diff --git a/sh/code.awk b/sh/code.awk index 33684e5..053f1be 100644 --- a/sh/code.awk +++ b/sh/code.awk @@ -46,7 +46,11 @@ BEGIN { } { - if (action == "aliases functions") { + if (action == "aliases") { + if (match($0, RE_ALIAS, m)) { + print m[1] + } + } else if (action == "aliases functions") { if (match($0, RE_ALIAS, m)) { append(m[1]) } else if (match($0, RE_FUNCTION, m)) { diff --git a/sh/main.sh b/sh/main.sh index 4ccb70b..8fe2884 100755 --- a/sh/main.sh +++ b/sh/main.sh @@ -202,7 +202,9 @@ ${RWX_REGEX_BEGIN}\\(${RWX_REGEX_VARIABLE}\\)${RWX_REGEX_SET}" _rwx_code_variables="" rwx_parse_code() { - # parse aliases commands + # parse aliases + _rwx_code_aliases="$(rwx_parse_aliases)" + # parse aliases functions local line text _rwx_code_aliases_functions="$(rwx_parse_aliases_functions)" while IFS= read -r line; do @@ -219,6 +221,12 @@ EOF # parse variables _rwx_code_variables="$(rwx_parse_variables)" } +rwx_parse_aliases() { + echo "${_rwx_code}" | + awk \ + --assign action="aliases" \ + "$(rwx_code_awk)" +} rwx_parse_aliases_functions() { printf "%s" "${_rwx_code}" | awk \ diff --git a/sh/test.sh b/sh/test.sh index dee1a65..69fcc4c 100644 --- a/sh/test.sh +++ b/sh/test.sh @@ -19,8 +19,8 @@ rwx_test_code() { "constants" \ "variables" \ "functions" \ - "aliases_functions" \ "aliases" \ + "aliases_functions" \ rwx_code for items in "${@}"; do From 16b772c8d981830a01d4227b910d6d0cb95a7fc7 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Mon, 7 Jul 2025 02:11:32 +0200 Subject: [PATCH 6/7] fix --- sh/code.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sh/code.sh b/sh/code.sh index fe73c91..8838276 100644 --- a/sh/code.sh +++ b/sh/code.sh @@ -19,6 +19,12 @@ rwx_code() { echo "${_rwx_code}" } +# show the cached aliases +#= rca +rwx_code_aliases() { + echo "${_rwx_code_aliases}" +} + # show the cached aliases and functions #= rcaf rwx_code_aliases_functions() { From 4151928013227bc2b97478bf30a30314e98e6308 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Mon, 7 Jul 2025 02:13:52 +0200 Subject: [PATCH 7/7] test/awk --- sh/test.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/sh/test.sh b/sh/test.sh index 69fcc4c..d017077 100644 --- a/sh/test.sh +++ b/sh/test.sh @@ -16,6 +16,7 @@ rwx_test() { rwx_test_code() { local items set \ + "awk" \ "constants" \ "variables" \ "functions" \