mawk/functions
This commit is contained in:
parent
601eef2326
commit
933fb93907
1 changed files with 5 additions and 5 deletions
|
@ -23,7 +23,7 @@ function extract(string, type) {
|
||||||
split(string, array, "#/")
|
split(string, array, "#/")
|
||||||
return trim(array[2])
|
return trim(array[2])
|
||||||
} else if (type == "function") {
|
} else if (type == "function") {
|
||||||
split(string, array, "()")
|
split(string, array, "(")
|
||||||
return trim(array[1])
|
return trim(array[1])
|
||||||
} else if (type == "module") {
|
} else if (type == "module") {
|
||||||
split(string, array, "#\\.")
|
split(string, array, "#\\.")
|
||||||
|
@ -124,12 +124,12 @@ BEGIN {
|
||||||
match_task = 0
|
match_task = 0
|
||||||
}
|
}
|
||||||
} else if (action == "aliases functions") {
|
} else if (action == "aliases functions") {
|
||||||
if (match($0, re["alias"], m)) {
|
if (match($0, re["alias"])) {
|
||||||
append(m[1])
|
append(extract($0, "alias"))
|
||||||
} else if (match($0, re["function"], m)) {
|
} else if (match($0, re["function"])) {
|
||||||
split(doc, array, "\n")
|
split(doc, array, "\n")
|
||||||
for (item in array) {
|
for (item in array) {
|
||||||
alias_eval(array[item], m[1], "function")
|
alias_eval(array[item], extract($0, "function"), "function")
|
||||||
}
|
}
|
||||||
reset()
|
reset()
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue