fix code that replaces format specifiers

master
CrossNox 3 years ago
parent f48f278b9f
commit 42b734d6c9
  1. 22
      src/rustint/core.clj

@ -2543,6 +2543,17 @@
(map last (re-seq #"\{:?(.\d+)?\}" s)) (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] (defn convertir-formato-impresion [args]
(let [clojure-fspecifiers ( (let [clojure-fspecifiers (
map map
@ -2552,16 +2563,7 @@
) )
] (if (empty? clojure-fspecifiers) ] (if (empty? clojure-fspecifiers)
args args
(cons (replace-groups (first args) clojure-fspecifiers) (rest args))
(into
(rest args)
(list (clojure.string/join
(interleave
(clojure.string/split (first args) #"\{:?(\.\d+)?\}")
(concat clojure-fspecifiers '(""))
)
))
)
) )
) )
) )

Loading…
Cancel
Save