This commit is contained in:
parent
30aead95e0
commit
1467c1158a
3 changed files with 72 additions and 43 deletions
14
sh/main.sh
14
sh/main.sh
|
@ -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"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue