Metacharacter

The metacharacters used in message names.

Parameters

javaString

The Java String denoting the metacharacter.

Entries

Link copied to clipboard

A back-quote (`) precedes a metacharacter to cause it to be treated as an ordinary character. Since no metacharacters are alphanumeric, and since non-alphanumeric characters are always tokenized individually, back-quote only operates on the single character following it. Note that since back-quote is itself a metacharacter, two successive backquotes indicates a single back-quote should be parsed from the Avail source code.

Link copied to clipboard

A close-guillemet (») indicates the end of a group or other structure that started with an OPEN_GUILLEMET open-guillemet («).

Link copied to clipboard

The double-dagger (‡) is used within a Group to delimit the left part, which repeats, from the right part, which separates occurrences of the left part.

Link copied to clipboard

The double-question-mark (⁇) is a single Unicode character (U+2047). It can be placed after a token or after a simple group (a group that has no right side and does not yield anything from its left side). In the case of a token, it allows zero or one occurrences of the token to occur in the Avail source, and discards information about whether the token was encountered. Similarly, when applied to a simple group it accepts zero or one occurrences of the group's left side, discarding the distinction. In both cases, the double-question-mark causes a CompletelyOptional to be built.

Link copied to clipboard

An ellipsis (…) indicates that a single token should be consumed from the Avail source code (tokens are produced from the actual file content via A_Lexers). There are a few variants:

Link copied to clipboard

The exclamation mark (!) can follow an ELLIPSIS (…) to cause creation of a RawTokenArgument, which matches any token that isn't whitespace or a comment.

Link copied to clipboard

When compiling indentation-sensitive languages, this message part matches whitespace that strictly increases the indentation beyond the indentation that was active when starting to parse the message. Note that the start position is not necessarily where the first token of the message occurred, since methods may start with leading arguments. In that case, the indentation refers to the whitespace at the start of the line where that leading argument begins.

Link copied to clipboard

When compiling indentation-sensitive languages, this message part matches whitespace that exactly matches the indentation that was active when starting to parse the message. Note that the start position is not necessarily where the first token of the message occurred, since methods may start with leading arguments. In that case, the indentation refers to the whitespace at the start of the line where that leading argument begins.

Link copied to clipboard

An octothorp (#) after an ELLIPSIS (…) indicates that a whole-number-valued literal token should be consumed from the Avail source code at this position. This is accomplished through the use of a RawLiteralTokenArgument.

Link copied to clipboard

An open-guillemet («) indicates the start of a group or other structure that will eventually end with a CLOSE_GUILLEMET (»).

Link copied to clipboard

A question mark (?) may follow a Simple expression, which creates an Optional, which yields a boolean literal indicating whether the token was present or not.

Link copied to clipboard

A section sign (§) indicates where, in the parsing of a macro invocation, it should invoke one of its prefix functions. The order of section signs in the method name corresponds with the order of the prefix functions.

Link copied to clipboard

A single-dagger (†) following an UNDERSCORE (_) causes creation of an ArgumentInModuleScope. This will parse an expression that does not use any variables in the local scope, then evaluate it and wrap it in a literal.

Link copied to clipboard

A space character separates alphanumeric tokens in a message name.

Link copied to clipboard

An Expression followed by a tilde (~) causes all Simple expressions anywhere within it to match case-insensitively to the tokens lexed from the Avail source code. All of these simple expressions are required to be specified in lower case to break a pointless symmetry about how to name the method.

Link copied to clipboard

An underscore indicates where a subexpression should be parsed.

Link copied to clipboard

If an up-arrow (↑) follows an UNDERSCORE, a VariableQuote is created, which expects a VariableUsePhraseDescriptor, which will be automatically converted into a reference phrase.

Link copied to clipboard

The vertical bar (|) separates alternatives within an Alternation. The alternatives may be Simple expressions, or simple Groups (having no double-dagger, and yielding no argument values).

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

The sole codepoint (Int) of this Metacharacter instance.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

The Avail A_String denoting this metacharacter.

Functions

Link copied to clipboard

Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Link copied to clipboard

Returns an array containing the constants of this enum type, in the order they're declared.