def HandleToken(self, token, last_non_space_token):
    self._is_block_close = False

    if not self._first_token:
      self._first_token = token

    # Track block depth.
    type = token.type
    if type == Type.START_BLOCK:
      self._block_depth += 1

      # Subclasses need to handle block start very differently because
      # whether a block is a CODE or OBJECT_LITERAL block varies significantly
      # by language.
      self._block_types.append(self.GetBlockType(token))

      # When entering a function body, record its parameters.
      if self.InFunction():
        function = self._function_stack[-1]
        if self._block_depth == function.block_depth + 1:
          function.parameters = self.GetParams()

    # Track block depth.
    elif type == Type.END_BLOCK:
      self._is_block_close = not self.InObjectLiteral()
      self._block_depth -= 1
      self._block_types.pop()

    # Track parentheses depth.
    elif type == Type.START_PAREN:
      self._paren_depth += 1

    # Track parentheses depth.
    elif type == Type.END_PAREN:
      self._paren_depth -= 1

    elif type == Type.COMMENT:
      self._last_comment = token.string

    elif type == Type.START_DOC_COMMENT:
      self._last_comment = None
      self._doc_comment = DocComment(token)

    elif type == Type.END_DOC_COMMENT:
      self._doc_comment.end_token = token

    elif type in (Type.DOC_FLAG, Type.DOC_INLINE_FLAG):
      # Don't overwrite flags if they were already parsed in a previous pass.
      if token.attached_object is None:
        flag = self._doc_flag(token)
        token.attached_object = flag
      else:
        flag = token.attached_object
      self._doc_comment.AddFlag(flag)

      if flag.flag_type == 'suppress':
        self._doc_comment.AddSuppression(token)

    elif type == Type.FUNCTION_DECLARATION:
      last_code = tokenutil.SearchExcept(token, Type.NON_CODE_TYPES, None,
                                         True)
      doc = None
      # Only top-level functions are eligible for documentation.
      if self.InTopLevel():
        doc = self._doc_comment

      name = ''
      is_assigned = last_code and (last_code.IsOperator('=') or
          last_code.IsOperator('||') or last_code.IsOperator('&&') or
          (last_code.IsOperator(':') and not self.InObjectLiteral()))
      if is_assigned:
        # TODO(robbyw): This breaks for x[2] = ...
        # Must use loop to find full function name in the case of line-wrapped
        # declarations (bug 1220601) like:
        # my.function.foo.
        #   bar = function() ...
        identifier = tokenutil.Search(last_code, Type.SIMPLE_LVALUE, None, True)
        while identifier and tokenutil.IsIdentifierOrDot(identifier):
          name = identifier.string + name
          # Traverse behind us, skipping whitespace and comments.
          while True:
            identifier = identifier.previous
            if not identifier or not identifier.type in Type.NON_CODE_TYPES:
              break

      else:
        next_token = tokenutil.SearchExcept(token, Type.NON_CODE_TYPES)
        while next_token and next_token.IsType(Type.FUNCTION_NAME):
          name += next_token.string
          next_token = tokenutil.Search(next_token, Type.FUNCTION_NAME, 2)

      function = Function(self._block_depth, is_assigned, doc, name)
      function.start_token = token

      self._function_stack.append(function)
      self._functions_by_name[name] = function

      # Add a delimiter in stack for scope variables to define start of
      # function. This helps in popping variables of this function when
      # function declaration ends.
      self._variables_in_scope.append('')

    elif type == Type.START_PARAMETERS:
      self._cumulative_params = ''

    elif type == Type.PARAMETERS:
      self._cumulative_params += token.string
      self._variables_in_scope.extend(self.GetParams())

    elif type == Type.KEYWORD and token.string == 'return':
      next_token = tokenutil.SearchExcept(token, Type.NON_CODE_TYPES)
      if not next_token.IsType(Type.SEMICOLON):
        function = self.GetFunction()
        if function:
          function.has_return = True

    elif type == Type.KEYWORD and token.string == 'throw':
      function = self.GetFunction()
      if function:
        function.has_throw = True

    elif type == Type.KEYWORD and token.string == 'var':
      function = self.GetFunction()
      next_token = tokenutil.Search(token, [Type.IDENTIFIER,
                                            Type.SIMPLE_LVALUE])

      if next_token:
        if next_token.type == Type.SIMPLE_LVALUE:
          self._variables_in_scope.append(next_token.values['identifier'])
        else:
          self._variables_in_scope.append(next_token.string)

    elif type == Type.SIMPLE_LVALUE:
      identifier = token.values['identifier']
      jsdoc = self.GetDocComment()
      if jsdoc:
        self._documented_identifiers.add(identifier)

      self._HandleIdentifier(identifier, True)

    elif type == Type.IDENTIFIER:
      self._HandleIdentifier(token.string, False)

      # Detect documented non-assignments.
      next_token = tokenutil.SearchExcept(token, Type.NON_CODE_TYPES)
      if next_token and next_token.IsType(Type.SEMICOLON):
        if (self._last_non_space_token and
            self._last_non_space_token.IsType(Type.END_DOC_COMMENT)):
          self._documented_identifiers.add(token.string)
Instantiates a new choice and adds it to this list. Signature is
dataset/ETHPy150Open google/closure-linter/closure_linter/statetracker.py/StateTracker.HandleToken--crossover with--dataset/ETHPy150Open lsaffre/lino/lino/core/choicelists.py/ChoiceList.add_item