This commit is contained in:
Marc Beninca 2025-08-02 19:47:53 +02:00
parent fa3970aa0e
commit 1567b1b863
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F

View file

@ -169,6 +169,11 @@ function parse(string) {
} else {
doc_reset()
}
}
if (match(string, RE_CLOSE)) {
current_match = "close"
}
}
@ -179,6 +184,7 @@ function parse(string) {
# doc
if (action == "doc") {
parse($0)
# doc
if (match($0, RE_DOC)) {
if (current_function) {
@ -186,6 +192,7 @@ if (action == "doc") {
} else {
doc_append(extract($0, "doc"))
}
# constant
} else if (current_match == "constant") {
if (constant == target) {
@ -194,6 +201,7 @@ if (action == "doc") {
doc_reset()
constant = ""
}
# variable
} else if (current_match == "variable") {
if (variable == target) {
@ -202,16 +210,19 @@ if (action == "doc") {
doc_reset()
variable = ""
}
# others
} else if (match($0, RE_CLOSE)) {
if (match_alias) {
}
# function
if (current_match == "close") {
if (target == current_function) {
doc_output(current_function, "function")
} else if (target in aliases) {
print "= " target
doc_output(current_function, "function")
} else if (match_command) {
} else if (target in commands) {
print "/ " target
doc_output(current_function, "function")
} else if (current_function == target) {
doc_output(current_function, "function")
} else {
current_function = ""
doc_reset()