Class SourceLines
java.lang.Object
org.ek9lang.compiler.repair.SourceLines
Line-level helpers the text rules share: indentation, a line with its literals masked out, the top-level
comma split. Package-private on purpose - a rule outside this package uses
SourceRepairs.-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final charWhat a masked character inside a String, backtick String or character literal is replaced by. -
Method Summary
Modifier and TypeMethodDescription(package private) static intThe number of leading spaces ofline.(package private) static String(package private) static Stringlinewith the content of every String, backtick String and character literal replaced byMASK, and a trailing//comment likewise - same length, so an index found in the mask is an index in the line.(package private) static intnextContent(List<String> lines, int index) The index of the nearest line afterindexwith content, or -1.(package private) static intpreviousContent(List<String> lines, int index) The index of the nearest line beforeindexwith content, or -1.(package private) static Stringlinequoted for a note, stripped.textsplit into lines, keeping a trailing empty line (so a join gives the text back).topLevelParts(String text) The parts oftextbetween its top-level commas - a comma inside brackets or a literal does not split - each stripped.
-
Field Details
-
MASK
static final char MASKWhat a masked character inside a String, backtick String or character literal is replaced by.- See Also:
-
-
Method Details
-
split
-
join
-
indent
The number of leading spaces ofline. -
masked
linewith the content of every String, backtick String and character literal replaced byMASK, and a trailing//comment likewise - same length, so an index found in the mask is an index in the line. A rule searching for code (&&, a comma,/*) searches the mask, so it never rewrites text inside a literal. -
topLevelParts
-
previousContent
-
nextContent
-
quoted
-