docs: def parse_belscript(lines):
      """Lines from the BELScript - can be an iterator or list
  
      yields Nanopubs in nanopubs_bel-1.0.0 format
      """
  
      nanopubs_metadata = {}
      annotations = {}
      assertions = []
  
      # # Turn a list into an iterator
      # if not isinstance(lines, collections.Iterator):
      #     lines = iter(lines)
  
      line_num = 0
  
      # for line in preprocess_belscript(lines):
      for line in set_single_line(lines):
  
          line_num += 1
          # Get rid of trailing comments
          line = re.sub("\/\/.*?$", "", line)
  
          line = line.rstrip()
  
          # Collapse continuation lines
          while re.search("\\\s*$", line):
              line = line.replace("\\", "") + next(lines)
  
          # Process lines #################################
          if re.match("\s*#", line) or re.match("\s*$", line):
              # Skip comments and empty lines
              continue
          elif re.match("SET DOCUMENT", line):
              nanopubs_metadata = process_documentline(line, nanopubs_metadata)
          elif re.match("DEFINE", line):
              nanopubs_metadata = process_definition(line, nanopubs_metadata)
          elif re.match("UNSET", line):
  
              # Process any assertions prior to changing annotations
              if assertions:
                  yield yield_nanopub(assertions, annotations, line_num)
                  assertions = []
              annotations = process_unset(line, annotations)
  
          elif re.match("SET", line):
              # Create nanopubs metadata prior to starting BEL Script statements section
              if nanopubs_metadata:
                  yield yield_metadata(nanopubs_metadata)
                  nanopubs_metadata = {}
  
              # Process any assertions prior to changing annotations
              if assertions:
                  yield yield_nanopub(assertions, annotations, line_num)
                  assertions = []
  
              annotations = process_set(line, annotations)
  
          else:
              assertions.append(line)
  
      # Catch any leftover bel statements
      yield_nanopub(assertions, annotations, line_num)