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