Class ServiceDeclarationForms
java.lang.Object
org.ek9lang.compiler.repair.ServiceDeclarationForms
THE service-form repair (Steve, 2026-10-11: one form each) - for every editing tool. Use this; do not
re-derive it. Three slips, each with ONE reading, each keyed on the diagnostic that proves it:
- E07671
'for' missing before ':/items'-Items :/items openbecomesItems for :/items open,byId() as GET :/{id}becomesbyId() as GET for :/{id}. - E07671
'as' missing before 'GET'-byId() GET for :/{id}becomesbyId() as GET for :/{id}. - E07670
'+' (use '+=')- a serviceoperator +becomesoperator +=(POST, a mutating add to the collection), andoperator -becomesoperator -=(DELETE).
Each rewrite stays within its line. The compiler keeps only the first error on a line, so a line missing both words is repaired over two passes of the caller's loop.
-
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 Stringsourcewithkeywordand a space inserted beforetoken: atcolumnwhen the token starts there, else at its one whole-word occurrence on the line; null when neither holds.static booleanTrue whentextmay hold one of the three slips.One pass: every slip a diagnostic proves, right to left on each line so earlier columns stay put.
-
Method Details
-
mayApply
True whentextmay hold one of the three slips. -
repair
-
inserted
-