Class StructuralReorderer
java.lang.Object
org.ek9lang.compiler.formatter.StructuralReorderer
Pass 2 of the EK9 source formatter: Structural Reordering.
Phase 1: Module-level reordering:
- Reference sorting: sorts
identifierReferenceentries within areferencesblock lexicographically - Module block ordering: orders
definesblocks by canonical type (constant, type, record, trait, class, function, component, text, service, application, program, package)
- Constructor colocation: constructors grouped at top of methods
- Overload colocation: same-name methods grouped together
- Operator canonical ordering: operators sorted by canonical order
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static enumCanonical ordering for module block types. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) EK9Parser.CompilationUnitContextparseToTree(String source) Parse the source to a CompilationUnitContext.(package private) StringApply structural reordering to the given canonically indented EK9 source.
-
Constructor Details
-
StructuralReorderer
StructuralReorderer()
-
-
Method Details
-
reorder
-
parseToTree
Parse the source to a CompilationUnitContext. Returns null if parsing encounters errors.
-