From 2b5fe88eeefef77114509dcb3c44964c963334f7 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 6 Jul 2025 09:47:16 +0200 Subject: [PATCH 1/3] close/useless --- sh/main.awk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sh/main.awk b/sh/main.awk index 2dca2cb..1476cf9 100644 --- a/sh/main.awk +++ b/sh/main.awk @@ -93,6 +93,8 @@ BEGIN { } else { reset() } + } else if (match($0, RE_CLOSE, m)) { + # TODO } else { if (module) { output(target, "module") From b6c962abde5160ab3d2f19bc00b5293819fe2cca Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 6 Jul 2025 09:49:00 +0200 Subject: [PATCH 2/3] =?UTF-8?q?=E2=86=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sh/main.awk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sh/main.awk b/sh/main.awk index 1476cf9..d12e61d 100644 --- a/sh/main.awk +++ b/sh/main.awk @@ -6,7 +6,8 @@ function append(line) { } function output(name, type) { - print name " ← " type + print "↙ " type + print name print doc exit } From d0596131ca890bc76e8327cc2937ff251ab6c963 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 6 Jul 2025 10:15:43 +0200 Subject: [PATCH 3/3] close/algorithm --- sh/main.awk | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/sh/main.awk b/sh/main.awk index d12e61d..911a4c1 100644 --- a/sh/main.awk +++ b/sh/main.awk @@ -13,7 +13,9 @@ function output(name, type) { } function reset() { - doc = "" + if (f == "") { + doc = "" + } } BEGIN { @@ -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")