mawk/functions

This commit is contained in:
Marc Beninca 2025-07-13 21:33:02 +02:00
parent 601eef2326
commit 933fb93907
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F

View file

@ -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 {