|
|
|
|
@ -2124,16 +2124,20 @@ |
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
|
|
|
|
|
|
|
|
|
(defn flistar [ilevel t nxt] |
|
|
|
|
(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 "{")) (clojure.string/join |
|
|
|
|
(cons "\n{\n" (repeat (* ilevel 2) " ")) |
|
|
|
|
) |
|
|
|
|
(= t (symbol "}")) "\n}" |
|
|
|
|
(= 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) |
|
|
|
|
) |
|
|
|
|
) |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
(defn listar [l] |
|
|
|
|
(let [contadores (hash-map (symbol "{") 1, (symbol "}") -1), |
|
|
|
|
|