Class FrontMatter
<?- ... -?> JSON front matter and its EK9 body - the one reader
of that format. Use it; never write another.
Three corpora share the format: the Q&A (qaExamples, read by org.ek9lang.assist.Ek9QaFileLoader
and, for its declared output, by the execution tests), the site examples (siteExamples, read by
org.ek9lang.site.SiteExampleSources) and the error catalogue's examples (errorExamples, read by
ErrorExamples). The site-examples spec (D3) requires one reader for all of them, so a change to the format -
a new delimiter rule, the //EOF trailer - happens here once. It lives in compiler-main (moved from
compiler-services' assist package, lane L0e) because the error catalogue is read here, by
ek9 -h <CODE> and -E3.
The front matter is an EK9 comment block, so the file still compiles; the body is everything after the
closing marker, trimmed, with a trailing //EOF removed (the corpus convention for "the source ends here").
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic StringThe EK9 source after the front matter, trimmed and without a trailing//EOF; the whole text (likewise trimmed) when there is no front matter.static booleanTrue when the text carries front matter.static StringThe JSON between the markers, trimmed, ornullwhen the text has no well-formed front matter.
-
Field Details
-
START
-
END
-
-
Method Details
-
json
-
body
The EK9 source after the front matter, trimmed and without a trailing//EOF; the whole text (likewise trimmed) when there is no front matter.EK9 REQUIRES
#!ek9as a file's first line and the example files put it BEFORE the front matter, so the body restores it as its own first line (Steve, 2026-10-12: every whole-file example shows it, so code copied from a page compiles and a capture's line N is the Nth line shown). THE one place that used to drop it; a region (SourceRegions.extract(String, String)) still shows only its region. -
has
True when the text carries front matter.
-