EXCLAMATION_MARK

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

When it follows an UNDERSCORE (_), it creates an ArgumentForMacroOnly, which matches any A_Phrase, even those that yield ⊤ or ⊥. Since these argument types are forbidden for methods, this construct can only be used in macros, where what is passed as an argument is a phrase yielding that type.

When an exclamation mark follows a guillemet group, that group must contain an alternation. If no alternatives produce a value, the effect is to push a constant corresponding with the alternative's one-based index in the alternation.

If the exclamation mark follows a guillemet group that contains an alternation where at least one alternative produces a value, it attempts to parse a series of alternative phrases. Each parsed phrase is numbered with an ascending one-based subscript, representing the order in which the phrases occurred in the source. The final effect is to push a single tuple with N elements, corresponding to the N alternatives. Each element is itself a tuple with an appropriate number of arguments for that alternative, but preceded by a natural number indicating the order of that phrase in the source.

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.