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

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.