unindent
All checks were successful
/ job (push) Successful in 2m55s

This commit is contained in:
Marc Beninca 2025-08-02 02:57:21 +02:00
parent 6918ff603f
commit 42ebc151c3
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F

View file

@ -1,5 +1,7 @@
# code # code
# functions
function alias_eval(alias, name, type) { function alias_eval(alias, name, type) {
text = alias "() { " text = alias "() { "
if (type == "function") { if (type == "function") {
@ -62,7 +64,10 @@ function trim(string) {
return text return text
} }
# begin
BEGIN { BEGIN {
RE_ANY = "(.*)" RE_ANY = "(.*)"
RE_BEGIN = "^" RE_BEGIN = "^"
RE_CONST = "([_A-Z][_0-9A-Z]*)" RE_CONST = "([_A-Z][_0-9A-Z]*)"
@ -95,13 +100,18 @@ BEGIN {
match_module = 0 match_module = 0
match_task = 0 match_task = 0
reset() reset()
} }
# main
{ {
if (action == "filter") { if (action == "filter") {
if (match($0, re[target])) { if (match($0, re[target])) {
unique[extract($0, target)] = "" unique[extract($0, target)] = ""
} }
} else if (action == "tasks") { } else if (action == "tasks") {
line++ line++
if (match($0, RE_MODULE)) { if (match($0, RE_MODULE)) {
@ -133,6 +143,7 @@ BEGIN {
doc = "" doc = ""
match_task = 0 match_task = 0
} }
} else if (action == "eval") { } else if (action == "eval") {
if (match($0, re[target])) { if (match($0, re[target])) {
append(extract($0, target)) append(extract($0, target))
@ -145,6 +156,7 @@ BEGIN {
} else { } else {
reset() reset()
} }
} else if (action == "function") { } else if (action == "function") {
if (match($0, re["command"])) { if (match($0, re["command"])) {
append(extract($0, "command")) append(extract($0, "command"))
@ -160,6 +172,7 @@ BEGIN {
} else { } else {
reset() reset()
} }
} else if (action == "doc") { } else if (action == "doc") {
# doc # doc
if (match($0, RE_SHEBANG)) { if (match($0, RE_SHEBANG)) {
@ -226,12 +239,17 @@ BEGIN {
} }
} }
} }
} }
# end
END { END {
if (action == "filter") { if (action == "filter") {
for (item in unique) { for (item in unique) {
print item print item
} }
} }
} }