Class SourceText
java.lang.Object
org.ek9lang.compiler.support.SourceText
public final class SourceText
extends Object
implements Function<org.antlr.v4.runtime.ParserRuleContext, String>
THE source of a parse rule as the developer wrote it: the characters it spans in the char stream, spaces kept. Use it
wherever source text is shown to a person or embedded in a message -
ctx.getText() joins the tokens with
nothing between them, so name? and age? becomes name?andage?. Falls back to getText() only
when the char stream is unavailable.
Hold one and apply it. On one line it is SourceTextOnOneLine; in a run-time message it is
SourceTextForMessage.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe longest source text embedded in a run-time message (anassertorrequirefailure). -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
MESSAGE_LENGTH
public static final int MESSAGE_LENGTHThe longest source text embedded in a run-time message (anassertorrequirefailure).- See Also:
-
-
Constructor Details
-
SourceText
public SourceText()
-
-
Method Details
-
apply
-