Class UnclosedBacktickString
java.lang.Object
org.ek9lang.compiler.repair.UnclosedBacktickString
THE E01093 repair - a backtick String closed with a double quote,
`${count} items" - for every
editing tool. Use this; do not re-derive the rule.
A backtick String does not end at a ", so it runs to the end of the file and never compiles:
the compiler reports E01093 at the backtick that opened it. When the rest of that line holds exactly one
" and no second backtick, that quote is the only close the writer can have meant - the opening
delimiter says which kind of String it is (and with ${ in it, the double-quoted reading is E07901
anyway) - so it becomes a backtick. Anything less certain is skipped and the refusal stands.
Measured: qwen3-coder T10 sent it in 33 of 118 runs of the harness record (37 would-fail), about a
round each, and once beside Type?: value - where the ?: repair was then thrown away
because nothing could repair the String.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordThe rewritten text and one note per rewrite;notesempty means nothing moved. -
Method Summary
Modifier and TypeMethodDescription(package private) static Stringsourcewith the one"after the backtick atcolumnmade a backtick, or null when there is no backtick there, no single"after it, or a second backtick.static StringclosedInEntry(String entry) The same repair for ONE statement entry, before the compile: the line whose backtick String is still open at its end, closed with a"- taken only when the entry does not parse as written and parses once closed, because a backtick String may legitimately span lines.(package private) static TextRule.RewriteclosedOnALine(List<String> lines, SyntaxProbe.SyntaxError failure) The text rule for a WHOLE source, whatever the parser said: the first line, at or before the failure, whose backtick String is still open at its end and holds exactly one"after the backtick - closed there.static booleanTrue whentextholds an ODD number of unescaped backticks - a String left open - the cheap gate before a probe compile (most files hold backticks; a closed file holds them in pairs).static StringThe note for a line closed asclosed.Close every String an E01093 diagnostic opens: the code must be E01093, its column the backtick, and the rest of that line must hold exactly one"and no backtick.
-
Method Details
-
mayApply
True whentextholds an ODD number of unescaped backticks - a String left open - the cheap gate before a probe compile (most files hold backticks; a closed file holds them in pairs). -
repair
public static UnclosedBacktickString.Result repair(String text, List<Map<String, Object>> diagnostics) Close every String an E01093 diagnostic opens: the code must be E01093, its column the backtick, and the rest of that line must hold exactly one"and no backtick. Rewrites within one line, so the receipts can follow (SourceRepairs). -
closedInEntry
The same repair for ONE statement entry, before the compile: the line whose backtick String is still open at its end, closed with a"- taken only when the entry does not parse as written and parses once closed, because a backtick String may legitimately span lines. Null when there is nothing to take. -
closedOnALine
The text rule for a WHOLE source, whatever the parser said: the first line, at or before the failure, whose backtick String is still open at its end and holds exactly one"after the backtick - closed there. Without E01093 the parser reports the String's END (the next backtick in the file, often far below) as a token error; the engine keeps the rewrite only when the parse then gets further, which is what makes a backtick String that legitimately spans lines safe here. -
noteFor
-
closedAt
-