diff --git a/sh/core/code.awk b/sh/core/code.awk index 9744d9c..aa9ad51 100644 --- a/sh/core/code.awk +++ b/sh/core/code.awk @@ -41,7 +41,7 @@ BEGIN { RE_CLOSE = RE_BEGIN "}" RE_SPACES RE_END RE_COMMAND = RE_BEGIN "#/" RE_SPACES RE_VAR RE_END RE_COMMENT = RE_BEGIN "#" RE_ANY RE_END - RE_CONSTANT = RE_BEGIN RE_CONST RE_SET RE_END + re["constant"] = RE_BEGIN RE_CONST RE_SET RE_END RE_DOC = RE_BEGIN RE_SPACES "#" RE_SPACE RE_ANY RE_END re["function"] = RE_BEGIN RE_VAR RE_FUNC RE_END RE_MODULE = RE_BEGIN "#\\." RE_SPACES RE_ANY RE_END @@ -70,10 +70,6 @@ BEGIN { if (match($0, RE_COMMAND, m)) { print m[1] } - } else if (action == "constants") { - if (match($0, RE_CONSTANT, m)) { - print m[1] - } } else if (action == "tasks") { if (match($0, RE_MODULE, m)) { if (output_tasks) { @@ -161,7 +157,7 @@ BEGIN { match_command = 1 } # set - } else if (match($0, RE_CONSTANT, m)) { + } else if (match($0, re["constant"], m)) { if (m[1] == target) { output(m[1], "constant") } else { diff --git a/sh/core/code.sh b/sh/core/code.sh index 0dce975..ed3e21b 100644 --- a/sh/core/code.sh +++ b/sh/core/code.sh @@ -250,7 +250,7 @@ EOF # parse commands _rwx_code_commands="$(rwx_code_parse "commands")" # parse constants - _rwx_code_constants="$(rwx_code_parse "constants")" + _rwx_code_constants="$(rwx_code_action_target "filter" "constants")" # parse functions _rwx_code_functions="$(rwx_code_action_target "filter" "function")" # parse tasks