strip_function

This commit is contained in:
Marc Beninca 2025-08-02 17:57:11 +02:00
parent 9bda167820
commit 0bf484f76c
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F

View file

@ -64,6 +64,13 @@ function remove_first(string, target, tmp) {
return trim(tmp) return trim(tmp)
} }
# TODO parent function
function strip_function(string, tmp) {
split(string, tmp, "(")
return trim(tmp[1])
}
function strip_value(string, tmp) { function strip_value(string, tmp) {
split(string, tmp, "=") split(string, tmp, "=")
return trim(tmp[1]) return trim(tmp[1])
@ -150,6 +157,11 @@ function parse(string) {
commands[command] = "" commands[command] = ""
doc_append("/ " command) doc_append("/ " command)
# function
} else if (match(string, re["function"])) {
current_match = "function"
current_function = strip_function(string)
# other # other
} else { } else {
if (module == target) { if (module == target) {
@ -191,8 +203,6 @@ if (action == "doc") {
variable = "" variable = ""
} }
# others # others
} else if (match($0, re["function"])) {
f = extract($0, "function")
} else if (match($0, RE_CLOSE)) { } else if (match($0, RE_CLOSE)) {
if (match_alias) { if (match_alias) {
print "= " target print "= " target