(self, ins)
Convert Python-string number representation to number token.
Convert Python-string number representation to number token.
Convert Python - string number representation to number token .
def _tokenise_number(self, ins):
        """Convert Python-string number representation to number token."""
        word = ins.read_number()
        if word[:2] == b'&H':
            # hex constant
            return self._values.new_integer().from_hex(word[2:]).to_token_hex()
        elif word[:2] == b'&O':
            # octal constant
            # read_number converts &1 into &O1
            return self._values.new_integer().from_oct(word[2:]).to_token_oct()
        elif word[:1] in DIGITS + b'.+-':
            # handle other numbers
            # note GW passes signs separately as a token
            # and only stores positive numbers in the program
            return self._values.from_repr(word, allow_nonnum=False).to_token()
def _tokenise_number ( self , ins ) : word = ins . read_number ( ) if word [ : 2 ] == b'&H' : # hex constant return self . _values . new_integer ( ) . from_hex ( word [ 2 : ] ) . to_token_hex ( ) elif word [ : 2 ] == b'&O' : # octal constant # read_number converts &1 into &O1 return self . _values . new_integer ( ) . from_oct ( word [ 2 : ] ) . to_token_oct ( ) elif word [ : 1 ] in DIGITS + b'.+-' : # handle other numbers # note GW passes signs separately as a token # and only stores positive numbers in the program return self . _values . from_repr ( word , allow_nonnum = False ) . to_token ( )