Pure-Clojure delimiter repair for Clojure source the model hand-wrote.
Ported from bhauman/clojure-mcp-light (clojure-mcp-light.delimiter-repair,
Apache-2.0): detect a real delimiter error with edamame, then repair via
parinferish indent-mode — parinfer trusts the INDENTATION to place the missing
/ extra ( [ {, which matches how the model intended the code to nest. The
parinfer-rust shell path + stats/json bits from upstream are dropped; this is
the pure JVM path only.
fix-delimiters is the entry point used by the clj_paren_repair tool.
Pure-Clojure delimiter repair for Clojure source the model hand-wrote.
Ported from bhauman/clojure-mcp-light (`clojure-mcp-light.delimiter-repair`,
Apache-2.0): detect a real delimiter error with edamame, then repair via
parinferish indent-mode — parinfer trusts the INDENTATION to place the missing
/ extra `( [ {`, which matches how the model intended the code to nest. The
parinfer-rust shell path + stats/json bits from upstream are dropped; this is
the pure JVM path only.
`fix-delimiters` is the entry point used by the `clj_paren_repair` tool.(delimiter-error? s)True when s fails to read specifically because of an unbalanced delimiter
(edamame reports :edamame/opened-delimiter). A non-delimiter read failure
still returns true — running parinfer is benign and may fix a hidden
imbalance — while clean source returns false.
True when `s` fails to read specifically because of an unbalanced delimiter (edamame reports `:edamame/opened-delimiter`). A non-delimiter read failure still returns true — running parinfer is benign and may fix a hidden imbalance — while clean source returns false.
(fix-delimiters s)Repair the delimiters of Clojure source s:
s unchangedRepair the delimiters of Clojure source `s`: - no delimiter error → `s` unchanged - repairable → the repaired string (which now parses clean) - unrepairable → nil Pure; never throws on a normal failure.
(parinferish-repair s)Repair s with parinferish indent-mode. Returns {:success bool :text S? :error msg?}.
Repair `s` with parinferish indent-mode. Returns `{:success bool :text S?
:error msg?}`.cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |