code/vars

This commit is contained in:
Marc Beninca 2025-07-07 02:45:58 +02:00
parent 40bd26f9ce
commit 45f0ebbb9b
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F
2 changed files with 17 additions and 27 deletions

View file

@ -181,26 +181,6 @@ rwx_find_shell() {
# │ main │ parse │
# ╰──────┴───────╯
RWX_REGEX_CONSTANT="[_A-Z][_0-9A-Z]*"
RWX_REGEX_FUNCTION="[_A-Za-z][_0-9A-Za-z]*"
RWX_REGEX_SET="=.*"
RWX_REGEX_SPACES="[[:space:]]*"
RWX_REGEX_VARIABLE="[_a-z][_0-9a-z]*"
RWX_REGEX_BEGIN="^"
RWX_REGEX_OPEN="\
${RWX_REGEX_SPACES}(${RWX_REGEX_SPACES})${RWX_REGEX_SPACES}{.*"
RWX_REGEX_TARGET_CONSTANT="\
${RWX_REGEX_BEGIN}\\(${RWX_REGEX_CONSTANT}\\)${RWX_REGEX_SET}"
RWX_REGEX_TARGET_FUNCTION="\
${RWX_REGEX_BEGIN}\\(${RWX_REGEX_FUNCTION}\\)${RWX_REGEX_OPEN}"
RWX_REGEX_TARGET_VARIABLE="\
${RWX_REGEX_BEGIN}\\(${RWX_REGEX_VARIABLE}\\)${RWX_REGEX_SET}"
# cache for code variables
_rwx_code_variables=""
rwx_parse_code() {
# parse aliases
_rwx_code_aliases="$(rwx_parse_aliases)"