From 933fb939073b589e2b9e9f748fe321d882ba0d57 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 13 Jul 2025 21:33:02 +0200 Subject: [PATCH] mawk/functions --- sh/core/code.awk | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sh/core/code.awk b/sh/core/code.awk index 5b9ddac..ee26ed1 100644 --- a/sh/core/code.awk +++ b/sh/core/code.awk @@ -23,7 +23,7 @@ function extract(string, type) { split(string, array, "#/") return trim(array[2]) } else if (type == "function") { - split(string, array, "()") + split(string, array, "(") return trim(array[1]) } else if (type == "module") { split(string, array, "#\\.") @@ -124,12 +124,12 @@ BEGIN { match_task = 0 } } else if (action == "aliases functions") { - if (match($0, re["alias"], m)) { - append(m[1]) - } else if (match($0, re["function"], m)) { + if (match($0, re["alias"])) { + append(extract($0, "alias")) + } else if (match($0, re["function"])) { split(doc, array, "\n") for (item in array) { - alias_eval(array[item], m[1], "function") + alias_eval(array[item], extract($0, "function"), "function") } reset() } else {