fix listar code

master
CrossNox 3 years ago
parent 6aa5442038
commit 203968960e
  1. 19
      src/rustint/core.clj

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

Loading…
Cancel
Save