parameters: (token)
return_statement: return result
docstring: Convert numeric strings into integers.
  
          @type  token: str
          @param token: String to parse.
  
          @rtype:  int
          @return: Parsed integer value.
docstring_summary: Convert numeric strings into integers.
docstring_tokens: Convert numeric strings into integers .
function: def integer(token):
          """
          Convert numeric strings into integers.
  
          @type  token: str
          @param token: String to parse.
  
          @rtype:  int
          @return: Parsed integer value.
          """
          token = token.strip()
          neg = False
          if token.startswith(compat.b('-')):
              token = token[1:]
              neg = True
          if token.startswith(compat.b('0x')):
              result = int(token, 16)     # hexadecimal
          elif token.startswith(compat.b('0b')):
              result = int(token[2:], 2)  # binary
          elif token.startswith(compat.b('0o')):
              result = int(token, 8)      # octal
          else:
              try:
                  result = int(token)     # decimal
              except ValueError:
                  result = int(token, 16) # hexadecimal (no "0x" prefix)
          if neg:
              result = -result
          return result
function_tokens: def integer ( token ) : token = token . strip ( ) neg = False if token . startswith ( compat . b ( '-' ) ) : token = token [ 1 : ] neg = True if token . startswith ( compat . b ( '0x' ) ) : result = int ( token , 16 ) # hexadecimal elif token . startswith ( compat . b ( '0b' ) ) : result = int ( token [ 2 : ] , 2 ) # binary elif token . startswith ( compat . b ( '0o' ) ) : result = int ( token , 8 ) # octal else : try : result = int ( token ) # decimal except ValueError : result = int ( token , 16 ) # hexadecimal (no "0x" prefix) if neg : result = - result return result