action/alias,doc
All checks were successful
/ job (push) Successful in 4m28s

This commit is contained in:
Marc Beninca 2025-07-06 06:41:44 +02:00
parent 30aead95e0
commit 1467c1158a
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F
3 changed files with 72 additions and 43 deletions

View file

@ -185,11 +185,25 @@ RWX_REGEX_TARGET_FUNCTION="\
${RWX_REGEX_BEGIN}\\(${RWX_REGEX_FUNCTION}\\)${RWX_REGEX_OPEN}"
rwx_parse_code() {
# parse aliases
local line
RWX_ALIASES="$(rwx_parse_aliases)"
while IFS= read -r line; do
eval "${line}"
done <<EOF
${RWX_ALIASES}
EOF
# parse constants
RWX_CONSTANTS="$(rwx_parse_constants)"
# parse functions
RWX_FUNCTIONS="$(rwx_parse_functions)"
}
rwx_parse_aliases() {
printf "%s" "${_rwx_code}" |
awk \
--assign action="alias" \
--file "${RWX_AWK}"
}
rwx_parse_constants() {
printf "%s\n" "${_rwx_code}" |
sed --silent "s|${RWX_REGEX_TARGET_CONSTANT}|\\1|p"