This commit is contained in:
Marc Beninca 2025-08-02 10:55:38 +02:00
parent 2183d22f4e
commit c70ce687bc
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F

View file

@ -112,41 +112,8 @@ function parse(string) {
# FIXME handle no action
# tasks
if (action == "tasks") {
line++
if (match($0, RE_MODULE)) {
line = 1
if (output_tasks) {
print ""
print output_module
print output_tasks
output_tasks = ""
}
doc = ""
match_task = 0
output_module = ". " extract($0, "module")
} else if (match($0, RE_TASK)) {
if (target) {
if (target == extract($0, "task")) {
match_task = 1
}
} else {
match_task = 1
}
append(line ": " $0)
} else if (match($0, RE_COMMENT)) {
append(line ": " $0)
} else {
if (match_task) {
output_tasks = output_tasks "\n" doc
}
doc = ""
match_task = 0
}
# doc
} else if (action == "doc") {
if (action == "doc") {
# doc
if (match($0, RE_SHEBANG)) {
append("! " extract($0, "shebang"))
@ -212,6 +179,39 @@ if (action == "tasks") {
}
}
# tasks
} else if (action == "tasks") {
line++
if (match($0, RE_MODULE)) {
line = 1
if (output_tasks) {
print ""
print output_module
print output_tasks
output_tasks = ""
}
doc = ""
match_task = 0
output_module = ". " extract($0, "module")
} else if (match($0, RE_TASK)) {
if (target) {
if (target == extract($0, "task")) {
match_task = 1
}
} else {
match_task = 1
}
append(line ": " $0)
} else if (match($0, RE_COMMENT)) {
append(line ": " $0)
} else {
if (match_task) {
output_tasks = output_tasks "\n" doc
}
doc = ""
match_task = 0
}
# function
} else if (action == "function") {
if (match($0, re["command"])) {