def AddLine(self, line):
    """Adds a line of text to the block. Paragraph type is auto-determined."""
    # Code blocks are treated differently:
    # Newlines aren't joined and blanklines aren't special.
    # See :help help-writing for specification.
    if self.paragraphs.IsType(paragraph.CodeBlock):
      # '<' exits code blocks.
      if line.startswith('<'):
        self.paragraphs.Close()
        line = line[1:].lstrip()
        if line:
          self.AddLine(line)
        return
      # Lines starting in column 0 exit code lines.
      if line[:1] not in ' \t':
        self.paragraphs.Close()
        self.AddLine(line)
        return
      self.paragraphs.AddLine(line)
      return
    # Always grab the required/optional args.
    self._ParseArgs(line)
    # Blank lines divide paragraphs.
    if not line.strip():
      self.paragraphs.SetType(paragraph.BlankLine)
      return
    # Start lists if you get a list item.
    match = regex.list_item.match(line or '')
    if match:
      leader = match.group(1)
      self.paragraphs.Close()
      line = regex.list_item.sub('', line)
      self.paragraphs.SetType(paragraph.ListItem, leader)
      self.paragraphs.AddLine(line)
      return
    if line and ' \t' in line[:1]:
      # Continue lists by indenting.
      if self.paragraphs.IsType(paragraph.ListItem):
        self.paragraphs.AddLine(line.lstrip())
        return
    elif self.paragraphs.IsType(paragraph.ListItem):
      self.paragraphs.Close()
    # Everything else is text.
    self.paragraphs.SetType(paragraph.TextParagraph)
    # Lines ending in '>' enter code blocks. Must have a space before if it if
    # not on a line by itself.
    if line == '>' or line.endswith(' >'):
      line = line[:-1].rstrip()
      if line:
        self.paragraphs.AddLine(line)
      self.paragraphs.SetType(paragraph.CodeBlock)
      return
    # Normal paragraph handling.
    self.paragraphs.AddLine(line)
dataset/ETHPy150Open google/vimdoc/vimdoc/block.py/Block.AddLine/swapped operands of `in`