QUESTION_MARK

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.

When a question mark follows a simple Group, i.e., one that has no DOUBLE_DAGGER (‡) and yields no values, it creates an Optional. This causes a boolean literal to be generated at a call site, indicating whether the sequence of tokens from that group actually occurred.

When a question mark follows a Group which produces one or more values, it simply limits that group to 0..1 occurrences. The DOUBLE_DAGGER (‡) is forbidden here as well, because the sequence after the double-dagger would only ever occur between repetitions, but there cannot be two of them.

Properties

Link copied to clipboard
val codepoint: Int

The sole codepoint (Int) of this Metacharacter instance.

Link copied to clipboard
val name: String
Link copied to clipboard
val ordinal: Int
Link copied to clipboard
val string: A_String

The Avail A_String denoting this metacharacter.