parent
b6c962abde
commit
d0596131ca
1 changed files with 10 additions and 6 deletions
14
sh/main.awk
14
sh/main.awk
|
@ -13,7 +13,9 @@ function output(name, type) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function reset() {
|
function reset() {
|
||||||
|
if (f == "") {
|
||||||
doc = ""
|
doc = ""
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
BEGIN {
|
BEGIN {
|
||||||
|
@ -38,6 +40,7 @@ BEGIN {
|
||||||
RE_VARIABLE = RE_BEGIN RE_VAR RE_SET RE_END
|
RE_VARIABLE = RE_BEGIN RE_VAR RE_SET RE_END
|
||||||
|
|
||||||
alias = 0
|
alias = 0
|
||||||
|
f = ""
|
||||||
reset()
|
reset()
|
||||||
module = 0
|
module = 0
|
||||||
}
|
}
|
||||||
|
@ -86,16 +89,17 @@ BEGIN {
|
||||||
module = 1
|
module = 1
|
||||||
}
|
}
|
||||||
} else if (match($0, RE_FUNCTION, m)) {
|
} else if (match($0, RE_FUNCTION, m)) {
|
||||||
|
f = m[1]
|
||||||
|
} else if (match($0, RE_CLOSE, m)) {
|
||||||
if (alias) {
|
if (alias) {
|
||||||
print "= " target
|
print "= " target
|
||||||
output(m[1], "function")
|
output(f, "function")
|
||||||
} else if (m[1] == target) {
|
} else if (f == target) {
|
||||||
output(target, "function")
|
output(f, "function")
|
||||||
} else {
|
} else {
|
||||||
|
f = ""
|
||||||
reset()
|
reset()
|
||||||
}
|
}
|
||||||
} else if (match($0, RE_CLOSE, m)) {
|
|
||||||
# TODO
|
|
||||||
} else {
|
} else {
|
||||||
if (module) {
|
if (module) {
|
||||||
output(target, "module")
|
output(target, "module")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue