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) {