filter/variables

This commit is contained in:
Marc Beninca 2025-07-11 03:31:24 +02:00
parent 65d701556a
commit 705e86f18b
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F
2 changed files with 4 additions and 4 deletions

View file

@ -47,7 +47,7 @@ BEGIN {
RE_MODULE = RE_BEGIN "#\\." RE_SPACES RE_ANY RE_END RE_MODULE = RE_BEGIN "#\\." RE_SPACES RE_ANY RE_END
RE_SHEBANG = RE_BEGIN "#!" RE_SPACES RE_ANY RE_END RE_SHEBANG = RE_BEGIN "#!" RE_SPACES RE_ANY RE_END
RE_TASK = RE_BEGIN RE_SPACES "#" RE_SPACES RE_TSK RE_ANY RE_END RE_TASK = RE_BEGIN RE_SPACES "#" RE_SPACES RE_TSK RE_ANY RE_END
RE_VARIABLE = RE_BEGIN RE_VAR RE_SET RE_END re["variable"] = RE_BEGIN RE_VAR RE_SET RE_END
f = "" f = ""
match_alias = 0 match_alias = 0
@ -98,7 +98,7 @@ BEGIN {
match_task = 0 match_task = 0
} }
} else if (action == "variables") { } else if (action == "variables") {
if (match($0, RE_VARIABLE, m)) { if (match($0, re["variable"], m)) {
print m[1] print m[1]
} }
} else if (action == "aliases functions") { } else if (action == "aliases functions") {
@ -167,7 +167,7 @@ BEGIN {
} else { } else {
reset() reset()
} }
} else if (match($0, RE_VARIABLE, m)) { } else if (match($0, re["variable"], m)) {
if (m[1] == target) { if (m[1] == target) {
output(m[1], "variable") output(m[1], "variable")
} else { } else {

View file

@ -256,7 +256,7 @@ EOF
# parse tasks # parse tasks
_rwx_code_tasks="$(rwx_code_parse "tasks")" _rwx_code_tasks="$(rwx_code_parse "tasks")"
# parse variables # parse variables
_rwx_code_variables="$(rwx_code_parse "variables")" _rwx_code_variables="$(rwx_code_action_target "filter" "variable")"
} }
rwx_code_parse() { rwx_code_parse() {