diff --git a/src/rustint/core.clj b/src/rustint/core.clj index 0daa5da..26a5333 100644 --- a/src/rustint/core.clj +++ b/src/rustint/core.clj @@ -2124,14 +2124,18 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defn flistar [ilevel t nxt] - (cond - (string? t) (format "\"%s\" " t) - (= t (symbol "{")) (clojure.string/join - (cons "\n{\n" (repeat (* ilevel 2) " ")) - ) - (= t (symbol "}")) "\n}" - (and (not= nxt (symbol "{")) (not= nxt (symbol "}"))) (format "%s " t) - :else (format "%s" t) + (let [ + preceding_space (clojure.string/join (repeat (* ilevel 2) " ")), + bracket_prec_space (clojure.string/join (repeat (* (- ilevel 1) 2) " ")) + ] + (cond + (string? t) (format "\"%s\" " t) + (= t (symbol "{")) (format "\n%s{\n%s" bracket_prec_space preceding_space) + (= t (symbol "}")) (format "\n%s}" bracket_prec_space) + (= t (symbol ";")) (format ";\n%s" preceding_space) + (and (not= nxt (symbol "{")) (not= nxt (symbol "}"))) (format "%s " t) + :else (format "%s" t) + ) ) )