From 705e86f18b90d91c2fa5f8f5ce06e66a5961eafd Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Fri, 11 Jul 2025 03:31:24 +0200 Subject: [PATCH] filter/variables --- sh/core/code.awk | 6 +++--- sh/core/code.sh | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sh/core/code.awk b/sh/core/code.awk index 3cc1b76..9744d9c 100644 --- a/sh/core/code.awk +++ b/sh/core/code.awk @@ -47,7 +47,7 @@ BEGIN { RE_MODULE = 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_VARIABLE = RE_BEGIN RE_VAR RE_SET RE_END + re["variable"] = RE_BEGIN RE_VAR RE_SET RE_END f = "" match_alias = 0 @@ -98,7 +98,7 @@ BEGIN { match_task = 0 } } else if (action == "variables") { - if (match($0, RE_VARIABLE, m)) { + if (match($0, re["variable"], m)) { print m[1] } } else if (action == "aliases functions") { @@ -167,7 +167,7 @@ BEGIN { } else { reset() } - } else if (match($0, RE_VARIABLE, m)) { + } else if (match($0, re["variable"], m)) { if (m[1] == target) { output(m[1], "variable") } else { diff --git a/sh/core/code.sh b/sh/core/code.sh index b21720c..a87b213 100644 --- a/sh/core/code.sh +++ b/sh/core/code.sh @@ -256,7 +256,7 @@ EOF # parse tasks _rwx_code_tasks="$(rwx_code_parse "tasks")" # parse variables - _rwx_code_variables="$(rwx_code_parse "variables")" + _rwx_code_variables="$(rwx_code_action_target "filter" "variable")" } rwx_code_parse() {