(self, var_name)
return new_identifier
Finds a new 1-character or 2-character name for a variable.

    Enters it into the mapping table for this scope.

    Args:
      var_name: The name of the variable before renaming.

    Returns:
      The new name of the variable.
Finds a new 1-character or 2-character name for a variable.
Finds a new 1 - character or 2 - character name for a variable .
def FindNewName(self, var_name):
    """Finds a new 1-character or 2-character name for a variable.

    Enters it into the mapping table for this scope.

    Args:
      var_name: The name of the variable before renaming.

    Returns:
      The new name of the variable.
    """
    new_identifier = ""
    # Variable names that end in _ are member variables of the global object,
    # so they can be visible from code in a different scope.  We leave them
    # alone.
    if var_name in self.map:
      return self.map[var_name]
    if self.nesting == 0:
      return var_name
    while True:
      identifier_first_char = self.identifier_counter % 52
      identifier_second_char = self.identifier_counter // 52
      new_identifier = self.CharFromNumber(identifier_first_char)
      if identifier_second_char != 0:
        new_identifier = (
            self.CharFromNumber(identifier_second_char - 1) + new_identifier)
      self.identifier_counter += 1
      if not new_identifier in self.seen_identifiers:
        break

    self.map[var_name] = new_identifier
    return new_identifier
def FindNewName ( self , var_name ) : new_identifier = "" # Variable names that end in _ are member variables of the global object, # so they can be visible from code in a different scope.  We leave them # alone. if var_name in self . map : return self . map [ var_name ] if self . nesting == 0 : return var_name while True : identifier_first_char = self . identifier_counter % 52 identifier_second_char = self . identifier_counter // 52 new_identifier = self . CharFromNumber ( identifier_first_char ) if identifier_second_char != 0 : new_identifier = ( self . CharFromNumber ( identifier_second_char - 1 ) + new_identifier ) self . identifier_counter += 1 if not new_identifier in self . seen_identifiers : break self . map [ var_name ] = new_identifier return new_identifier