Class SourceRegions
java.lang.Object
org.ek9lang.compiler.common.SourceRegions
THE reader of the region and elide markers in a compiled example source (site-examples spec ยง3.4, decision D5) -
every page fragment is cut from a whole, compiled source through here; never parse the markers anywhere else.
// region: anatomy a region a page may show: classes/classes_anatomy.ek9#anatomy // end region: anatomy // elide: constructors lines the page shows as ONE comment, "// ... constructors" // end elide: constructors
A marker is an EK9 comment WITH text (a bare // line is a syntax error), so the source still compiles
exactly as written. Regions may nest, and a region name is unique within its file. An elided run is rendered as
ONE comment line at the marker's indentation, // ... <name> - never a bare ... line, which is EK9's
range operator, does not compile, and would teach a model that it is legal (Steve, D5).
Two views of one source, each a class to hold an instance of (no statics, Steve 2026-10-28):
SourceRegionExtract- what a page shows: a region (or the whole body), markers removed, elided runs collapsed, dedented to its least-indented line;SourceRegionFull- the "full source" page: every line, markers removed, with the line each region starts on so the page can carry anidper region.
SourceRegionProblems checks the markers and SourceRegionNames lists the regions.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordA source with its markers removed, and the line each region starts on.(package private) static enumThe kind of a marker line.(package private) static final recordOne marker line: whether it opens or closes, its kind, its name and its indentation. -
Field Summary
Fields -
Method Summary
-
Field Details
-
MARKER
-
REGION_NAME
-