Class IndentLevels
java.lang.Object
org.ek9lang.compiler.formatter.IndentLevels
- All Implemented Interfaces:
Function<org.antlr.v4.runtime.CommonTokenStream, IndentLevels.Levels>
final class IndentLevels
extends Object
implements Function<org.antlr.v4.runtime.CommonTokenStream, IndentLevels.Levels>
THE indent level Pass 1 gives each line -
CanonicalIndenter lays the lines out by it, and
LineSplitter asks it where a line it makes will be kept, so formatting the result again changes nothing.
A line's level is the number of INDENTs open at its first token. A line whose first token is inside ( [ { is a free-format zone (the lexer gives no INDENT or DEDENT there): Pass 1 keeps its indentation as written. A closing bracket that closes the outermost one is not inside: on its own line it lines up with its statement.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static final recordThe levels of a source's lines. -
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
IndentLevels
IndentLevels()
-
-
Method Details
-
apply
- Specified by:
applyin interfaceFunction<org.antlr.v4.runtime.CommonTokenStream, IndentLevels.Levels>
-