Skip to content

yex.parse.Argument

yex.parse.Argument(ch, location=None) #

Bases: yex.parse.token.MagicToken

A token representing an argument, such as #3.

This can only be generated internally; it exists to make yex's code simpler.

Source code in yex/parse/token.py
106
107
108
109
110
111
112
113
114
def __init__(self,
             ch: int,
             location: Union['yex.parse.Location', None] = None):

    if type(self)==Token:
        raise yex.exception.ConstructorError()

    self.ch = ch
    self.location = location

index property #

The index of this argument. For example, the index of #3 is 3.