Interface TextRule
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
One text rule of
SourceRepairs: given a source's lines and the parse failure the parser stopped on, the
rewrite that answers it - or null when this rule does not recognise the failure.
A rule applies only where its shape has exactly ONE plausible reading and the literal reading does not parse (so the rewrite cannot change which code runs: the original never ran). The engine keeps a rewrite only when the parse then gets further than before; a rule never needs to re-check that itself.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final recordA rule's rewrite: the new lines, and the note that says what was written and why. -
Method Summary
Modifier and TypeMethodDescriptionapply(List<String> lines, SyntaxProbe.SyntaxError failure) The rewrite oflinesansweringfailure, or null.
-
Method Details
-
apply
The rewrite oflinesansweringfailure, or null.- Parameters:
lines- the source's lines (never modified by a rule - a rewrite carries its own copy)failure- the first syntax error, as the parser reported it
-