From 73fe260aea9e2dd1197216430353eddde31f43f2 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 2 Aug 2025 17:59:47 +0200 Subject: [PATCH] strip_from --- sh/core/code.awk | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/sh/core/code.awk b/sh/core/code.awk index 784d25f..f938f7a 100644 --- a/sh/core/code.awk +++ b/sh/core/code.awk @@ -64,16 +64,17 @@ function remove_first(string, target, tmp) { return trim(tmp) } -# TODO parent function - -function strip_function(string, tmp) { - split(string, tmp, "(") +function strip_from(string, sep, tmp) { + split(string, tmp, sep) return trim(tmp[1]) } +function strip_function(string, tmp) { + return strip_from(string, "(") +} + function strip_value(string, tmp) { - split(string, tmp, "=") - return trim(tmp[1]) + return strip_from(string, "=") } function trim(string) {