improve listar

master
CrossNox 3 years ago
parent 824182d12c
commit 91c5d80df3
  1. 20
      src/rustint/core.clj

@ -2124,14 +2124,18 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defn flistar [ilevel t nxt] (defn flistar [ilevel t nxt]
(cond (let [
(string? t) (format "\"%s\" " t) preceding_space (clojure.string/join (repeat (* ilevel 2) " ")),
(= t (symbol "{")) (clojure.string/join bracket_prec_space (clojure.string/join (repeat (* (- ilevel 1) 2) " "))
(cons "\n{\n" (repeat (* ilevel 2) " ")) ]
) (cond
(= t (symbol "}")) "\n}" (string? t) (format "\"%s\" " t)
(and (not= nxt (symbol "{")) (not= nxt (symbol "}"))) (format "%s " t) (= t (symbol "{")) (format "\n%s{\n%s" bracket_prec_space preceding_space)
:else (format "%s" t) (= 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)
)
) )
) )

Loading…
Cancel
Save