From 42b734d6c98a6a52fde81ab1a079e04a7bf5ddea Mon Sep 17 00:00:00 2001 From: CrossNox Date: Tue, 29 Nov 2022 13:49:03 -0300 Subject: [PATCH] fix code that replaces format specifiers --- src/rustint/core.clj | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/src/rustint/core.clj b/src/rustint/core.clj index 22d1cbd..217c456 100644 --- a/src/rustint/core.clj +++ b/src/rustint/core.clj @@ -2543,6 +2543,17 @@ (map last (re-seq #"\{:?(.\d+)?\}" s)) ) +(defn replace-groups [string groups] + (if (empty? groups) + string + ( + replace-groups + (clojure.string/replace-first string #"\{:?(.\d+)?\}" (first groups)) + (rest groups) + ) + ) +) + (defn convertir-formato-impresion [args] (let [clojure-fspecifiers ( map @@ -2552,18 +2563,9 @@ ) ] (if (empty? clojure-fspecifiers) args - - (into - (rest args) - (list (clojure.string/join - (interleave - (clojure.string/split (first args) #"\{:?(\.\d+)?\}") - (concat clojure-fspecifiers '("")) - ) - )) - ) + (cons (replace-groups (first args) clojure-fspecifiers) (rest args)) ) - ) + ) ) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;