From dfc7a776f59083ff8882bcd4aad18e2afa0d3912 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 2 Aug 2025 18:01:09 +0200 Subject: [PATCH] strip_first --- sh/core/code.awk | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sh/core/code.awk b/sh/core/code.awk index f938f7a..3273ce6 100644 --- a/sh/core/code.awk +++ b/sh/core/code.awk @@ -58,7 +58,7 @@ function extract(string, type) { } } -function remove_first(string, target, tmp) { +function strip_first(string, target, tmp) { tmp = string sub(target, "", tmp) return trim(tmp) @@ -125,14 +125,14 @@ function parse(string) { # module if (match(string, RE_MODULE)) { current_match = "module" - module = remove_first(string, "#\\.") + module = strip_first(string, "#\\.") doc_reset() shebang = "" # shebang } else if (match(string, RE_SHEBANG)) { current_match = "shebang" - shebang = remove_first(string, "#!") + shebang = strip_first(string, "#!") # constant } else if (match(string, re["constant"])) { @@ -147,14 +147,14 @@ function parse(string) { # alias } else if (match(string, re["alias"])) { current_match = "alias" - alias = remove_first(string, "#=") + alias = strip_first(string, "#=") aliases[alias] = "" doc_append("= " alias) # command } else if (match(string, re["command"])) { current_match = "command" - command = remove_first(string, "#/") + command = strip_first(string, "#/") commands[command] = "" doc_append("/ " command)