Compare commits
3 commits
aeff5a62f2
...
d0596131ca
Author | SHA1 | Date | |
---|---|---|---|
d0596131ca | |||
b6c962abde | |||
2b5fe88eee |
1 changed files with 12 additions and 5 deletions
17
sh/main.awk
17
sh/main.awk
|
@ -6,13 +6,16 @@ function append(line) {
|
|||
}
|
||||
|
||||
function output(name, type) {
|
||||
print name " ← " type
|
||||
print "↙ " type
|
||||
print name
|
||||
print doc
|
||||
exit
|
||||
}
|
||||
|
||||
function reset() {
|
||||
doc = ""
|
||||
if (f == "") {
|
||||
doc = ""
|
||||
}
|
||||
}
|
||||
|
||||
BEGIN {
|
||||
|
@ -37,6 +40,7 @@ BEGIN {
|
|||
RE_VARIABLE = RE_BEGIN RE_VAR RE_SET RE_END
|
||||
|
||||
alias = 0
|
||||
f = ""
|
||||
reset()
|
||||
module = 0
|
||||
}
|
||||
|
@ -85,12 +89,15 @@ 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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue