code: def _comment_handler(c, ctx, whence):
      
      assert c == _SLASH
      c, self = yield
      if c == _SLASH:
          ctx.set_line_comment()
          block_comment = False
      elif c == _ASTERISK:
          if ctx.line_comment:
              # This happens when a block comment immediately follows a line comment.
              ctx.set_line_comment(False)
          block_comment = True
      else:
          _illegal_character(c, ctx, 'Illegal character sequence "/%s".' % (_chr(c),))
      done = False
      prev = None
      trans = ctx.immediate_transition(self)
      while not done:
          c, _ = yield trans
          if block_comment:
              if prev == _ASTERISK and c == _SLASH:
                  done = True
              prev = c
          else:
              if c in _NEWLINES or BufferQueue.is_eof(c):
                  done = True
      yield ctx.set_self_delimiting(True).immediate_transition(whence)
docs: Handles comments. Upon completion of the comment, immediately transitions back to `whence`.