diff --git a/sh/core/code.awk b/sh/core/code.awk index 11aa865..f0b9b9f 100644 --- a/sh/core/code.awk +++ b/sh/core/code.awk @@ -242,42 +242,6 @@ function parse(string) { } -function parse_next(string) { - - # constant - if (current_match == "constant") { - doc_reset() - constant = "" - - # variable - } else if (current_match == "variable") { - doc_reset() - variable = "" - - # alias - } else if (current_match == "alias") { - alias = "" - - # command - } else if (current_match == "command") { - command = "" - - # task - } else if (current_match == "task") { - task = "" - - # close - } else if (current_match == "close") { - doc_reset() - current_function = "" - - # match - } - - # next - line++ -} - # ╭──────┬──────╮ # │ code │ main │ # ╰──────┴──────╯ @@ -288,7 +252,7 @@ function parse_next(string) { # │ code │ main │ parse │ # ╰──────┴──────┴───────╯ -parse($0) +# TODO parse($0) # ╭──────┬──────┬──────╮ # │ code │ main │ exit │ @@ -427,7 +391,38 @@ if (action == "doc") { # │ code │ main │ next │ # ╰──────┴──────┴──────╯ -parse_next($0) + # constant + if (current_match == "constant") { + doc_reset() + constant = "" + + # variable + } else if (current_match == "variable") { + doc_reset() + variable = "" + + # alias + } else if (current_match == "alias") { + alias = "" + + # command + } else if (current_match == "command") { + command = "" + + # task + } else if (current_match == "task") { + task = "" + + # close + } else if (current_match == "close") { + doc_reset() + current_function = "" + + # match + } + + # next + line++ # main } @@ -438,18 +433,18 @@ parse_next($0) END { -# filter -if (action == "filter") { - for (item in unique) { - print item + # filter + if (action == "filter") { + for (item in unique) { + print item + } + + # lint + } else if (action == "lint") { + print lint + + # action } -# lint -} else if (action == "lint") { - print lint - -# action -} - # end }