sed/constants
This commit is contained in:
parent
30882f3fd9
commit
f6f13a86e3
1 changed files with 7 additions and 2 deletions
|
@ -171,6 +171,11 @@ RWX_REGEX_BEGIN="^${RWX_REGEX_SPACES}"
|
|||
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_parse_code() {
|
||||
# parse constants
|
||||
RWX_CONSTANTS="$(rwx_parse_constants)"
|
||||
|
@ -180,12 +185,12 @@ rwx_parse_code() {
|
|||
rwx_parse_constants() {
|
||||
printf "%s\n" "${RWX_CODE}" |
|
||||
grep "${RWX_REGEX_BEGIN}${RWX_REGEX_CONSTANT}${RWX_REGEX_SET}" |
|
||||
sed "s|${RWX_REGEX_BEGIN}\\(${RWX_REGEX_CONSTANT}\\)${RWX_REGEX_SET}|\\1|"
|
||||
sed "s|${RWX_REGEX_TARGET_CONSTANT}|\\1|"
|
||||
}
|
||||
rwx_parse_functions() {
|
||||
printf "%s\n" "${RWX_CODE}" |
|
||||
grep "${RWX_REGEX_BEGIN}${RWX_REGEX_FUNCTION}${RWX_REGEX_OPEN}" |
|
||||
sed "s|${RWX_REGEX_BEGIN}\\(${RWX_REGEX_FUNCTION}\\)${RWX_REGEX_OPEN}|\\1|"
|
||||
sed "s|${RWX_REGEX_TARGET_FUNCTION}|\\1|"
|
||||
}
|
||||
|
||||
# ╭──────┬─────╮
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue