fix,current_function
This commit is contained in:
parent
d51d635252
commit
20b5b095b2
1 changed files with 8 additions and 9 deletions
|
@ -27,7 +27,7 @@ function doc_output(name, type) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function doc_reset() {
|
function doc_reset() {
|
||||||
if (f == "") {
|
if (current_function == "") {
|
||||||
doc = ""
|
doc = ""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -94,7 +94,6 @@ RE_SHEBANG = RE_BEGIN "#!" RE_SPACES RE_ANY RE_END
|
||||||
RE_TASK = RE_BEGIN RE_SPACES "#" RE_SPACES RE_TSK RE_ANY RE_END
|
RE_TASK = RE_BEGIN RE_SPACES "#" RE_SPACES RE_TSK RE_ANY RE_END
|
||||||
re["variable"] = RE_BEGIN RE_VAR RE_SET RE_END
|
re["variable"] = RE_BEGIN RE_VAR RE_SET RE_END
|
||||||
|
|
||||||
f = ""
|
|
||||||
match_alias = 0
|
match_alias = 0
|
||||||
match_command = 0
|
match_command = 0
|
||||||
match_task = 0
|
match_task = 0
|
||||||
|
@ -124,7 +123,7 @@ function parse(string) {
|
||||||
|
|
||||||
# other
|
# other
|
||||||
} else {
|
} else {
|
||||||
if (module = target) {
|
if (module == target) {
|
||||||
doc_output(target, "module")
|
doc_output(target, "module")
|
||||||
} else {
|
} else {
|
||||||
doc_reset()
|
doc_reset()
|
||||||
|
@ -141,7 +140,7 @@ if (action == "doc") {
|
||||||
parse($0)
|
parse($0)
|
||||||
# doc
|
# doc
|
||||||
if (match($0, RE_DOC)) {
|
if (match($0, RE_DOC)) {
|
||||||
if (f) {
|
if (current_function) {
|
||||||
doc_append($0)
|
doc_append($0)
|
||||||
} else {
|
} else {
|
||||||
doc_append(extract($0, "doc"))
|
doc_append(extract($0, "doc"))
|
||||||
|
@ -179,14 +178,14 @@ if (action == "doc") {
|
||||||
} else if (match($0, RE_CLOSE)) {
|
} else if (match($0, RE_CLOSE)) {
|
||||||
if (match_alias) {
|
if (match_alias) {
|
||||||
print "= " target
|
print "= " target
|
||||||
doc_output(f, "function")
|
doc_output(current_function, "function")
|
||||||
} else if (match_command) {
|
} else if (match_command) {
|
||||||
print "/ " target
|
print "/ " target
|
||||||
doc_output(f, "function")
|
doc_output(current_function, "function")
|
||||||
} else if (f == target) {
|
} else if (current_function == target) {
|
||||||
doc_output(f, "function")
|
doc_output(current_function, "function")
|
||||||
} else {
|
} else {
|
||||||
f = ""
|
current_function = ""
|
||||||
doc_reset()
|
doc_reset()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue