The delimiter repair format is allowed to WRITE, and what it must SAY about it.
The repair is ADD-ONLY: a delimiter you omitted is added back, one you WROTE is
never deleted. A lost opening ( and one ) too many are the same string, so
deleting is a guess that rewrites code. parinferish proposes the candidate and
parinferish.balance accepts it only when it provably parses and only ADDS — a
file whose delimiters already balance is answered untouched.
The delimiter repair `format` is allowed to WRITE, and what it must SAY about it. The repair is ADD-ONLY: a delimiter you omitted is added back, one you WROTE is never deleted. A lost opening `(` and one `)` too many are the same string, so deleting is a guess that rewrites code. `parinferish` proposes the candidate and `parinferish.balance` accepts it only when it provably parses and only ADDS — a file whose delimiters already balance is answered untouched.
(parses-clean? source)True when source reads as Clojure from end to end. Reader conditionals are
allowed and an unknown tagged literal reads as its value, so a perfectly good
.cljc file is never mistaken for a broken one. Evaluation stays off.
True when `source` reads as Clojure from end to end. Reader conditionals are allowed and an unknown tagged literal reads as its value, so a perfectly good `.cljc` file is never mistaken for a broken one. Evaluation stays off.
(repair-source code)Repair code's delimiters when they do not balance, over the whole file — the only
span a formatter has.
Answers {:code <what to format> :repaired? bool :repairs [note] :why msg?}. On a
refusal the ORIGINAL code goes to the formatter untouched and :why names the
mistake to look for, because a formatter that guesses which of the two happened is
the corruption it was meant to prevent.
Repair `code`'s delimiters when they do not balance, over the whole file — the only
span a formatter has.
Answers `{:code <what to format> :repaired? bool :repairs [note] :why msg?}`. On a
refusal the ORIGINAL code goes to the formatter untouched and `:why` names the
mistake to look for, because a formatter that guesses which of the two happened is
the corruption it was meant to prevent.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 |