Class ErrorDirectiveText

java.lang.Object
org.ek9lang.compiler.common.ErrorDirectiveText

public final class ErrorDirectiveText extends Object
THE text-level reading of the @Error: PHASE: CLASSIFICATION directive lines in an example SOURCE - for the readers that show an error example to a person or a model, not for the compiler (which parses directives with the grammar and checks them with ErrorDirectiveListener). Use it; never write another regex for these lines.

Shared by the site's code block renderer and publisher (org.ek9lang.site.Ek9CodeBlockRenderer, SiteExamplePublisher, QaPageRenderer), the error catalogue (ErrorExamples, whose plain-text [EXAMPLE] reaches ek9 -h <CODE> and -E3) and the gates that check those examples. The source keeps its directive lines, where a gate reads them; a reader is shown the source without them and one caption naming the error ("Fails with E05240: <meaning>", decision D4 of the site-examples spec).

No statics (Steve, 2026-10-28): this class holds the one pattern; each reading is a class to hold an instance of - IsErrorExample, WithoutErrorDirectives, ErrorDirectiveCodes, ErrorDirectivePhases, ExpectedErrorLines - and ErrorCodeMeaning gives a code's one-line meaning.

  • Field Details

    • ERROR_DIRECTIVE

      static final Pattern ERROR_DIRECTIVE
      THE @Error: PHASE: CLASSIFICATION directive line: group 1 the phase, group 2 the classification.