Private: parses the values of a TopDoc comment.

* `node` {Object} PostCSS node.
* `regex` {RegExp} used to identify TopDoc comments.
* `includeNodes` {Boolean} will include the nodes in the component if true.

Returns {Object} Component
13224
function _parseTopdocComment(node, regex, includeNodes) {
  const content = node.text.replace(regex, '');
  const component = new TopComponent(yaml.safeLoad(content));
  if (includeNodes) component.nodes = [];
  component.commentStart = node.source.start;
  component.commentEnd = node.source.end;
  component.css = '';
  return component;
}
960276
function parse(node) {
  var link = {}
  var url = node.url || node.href || ''
  var start
  var end
  var page

  if (
    url.slice(0, GH_URL_PREFIX_LENGTH) !== GH_URL_PREFIX ||
    node.children.length !== 1 ||
    node.children[0].type !== 'text' ||
    toString(node).slice(0, GH_URL_PREFIX_LENGTH) !== GH_URL_PREFIX
  ) {
    return
  }

  start = GH_URL_PREFIX_LENGTH
  end = usernameEnd(url, GH_URL_PREFIX_LENGTH)

  if (end === -1 || url.charCodeAt(end) !== CC_SLASH) {
    return
  }

  link.user = url.slice(start, end)

  start = end + 1
  end = projectEnd(url, start)

  if (end === -1 || url.charCodeAt(end) !== CC_SLASH) {
    return
  }

  link.project = url.slice(start, end)

  start = end + 1
  end = url.indexOf('/', start)

  if (end === -1) {
    return
  }

  page = url.slice(start, end)

  if (page !== parse.COMMIT && page !== parse.ISSUE && page !== parse.PULL) {
    return
  }

  link.page = page
  start = end + 1

  if (page === parse.COMMIT) {
    end = shaEnd(url, start, true)
  } else {
    end = issueEnd(url, start)
  }

  if (end === -1) {
    return
  }

  link.reference = url.slice(start, end)
  link.comment = url.charCodeAt(end) === CC_HASH && url.length > end + 1

  return link
}
1246439
def parse_comment(self, comment, filename, lineno, endlineno,
                      include_paths=None, stripped=False):
        
        if not stripped and not self.__validate_c_comment(comment.strip()):
            return None

        title_offset = 0

        column_offset = 0

        raw_comment = comment
        if not stripped:
            try:
                while comment[column_offset * -1 - 1] != '\n':
                    column_offset += 1
            except IndexError:
                column_offset = 0
            comment, title_offset = self.__strip_comment(comment)

        title_and_params, description = self.__extract_titles_params_and_description(comment)
        try:
            block_name, parameters, annotations, is_section = \
                self.__parse_title_and_parameters(filename, title_and_params)
        except HotdocSourceException as _:
            warn('gtk-doc-bad-syntax',
                 message=_.message,
                 filename=filename,
                 lineno=lineno + title_offset)
            return None

        params_offset = 0
        for param in parameters:
            param.filename = filename
            param.lineno = lineno
            param_offset = param.line_offset
            param.line_offset = title_offset + params_offset + 1
            params_offset += param_offset
            param.col_offset = column_offset

        if not block_name:
            return None

        description_offset = 0
        meta = {}
        tags = []
        if description is not None:
            n_lines = len(comment.split('\n'))
            description_offset = (title_offset + n_lines -
                                  len(description.split('\n')))
            meta['description'], tags = self.__parse_description_and_tags(description)

        actual_parameters = OrderedDict({})
        for param in parameters:
            if is_section:
                cleaned_up_name = param.name.lower().replace('_', '-')
                if cleaned_up_name in ['symbols', 'private-symbols', 'auto-sort', 'sources']:
                    meta.update(self.__parse_yaml_comment(param, filename))
                    if cleaned_up_name == 'sources':
                        sources_paths = [os.path.abspath(os.path.join(os.path.dirname(filename), path)) for path in meta[cleaned_up_name]]
                        meta[cleaned_up_name] = sources_paths
                else:
                    meta[param.name] = param.description
            else:
                actual_parameters[param.name] = param

        annotations = {annotation.name: annotation for annotation in
                       annotations}
        tags = {tag.name.lower(): tag for tag in tags}

        block = Comment(name=block_name, filename=filename, lineno=lineno,
                        endlineno=endlineno,
                        annotations=annotations, params=actual_parameters,
                        tags=tags, raw_comment=raw_comment,
                        meta=meta, toplevel=is_section)
        block.line_offset = description_offset
        block.col_offset = column_offset

        return block
853711
function parseSLComment(css) {
    var start = pos;

    // Read the string until we meet line break.
    // Since we already know first 2 characters (`//`), start reading
    // from `pos + 2`:
    for (pos += 2; pos < css.length; pos++) {
      if (css.charAt(pos) === '\n' || css.charAt(pos) === '\r') {
        break;
      }
    }

    // Add comment (including `//` and line break) to the list of tokens:
    pushToken(TokenType.CommentSL, css.substring(start, pos--), col);
    col += pos - start;
  }
934920
function(){
    var obj = new nodes.Object
      , id, val, comma, hash;
    this.expect('{');
    this.skipWhitespace();

    while (!this.accept('}')) {
      if (this.accept('comment')
        || this.accept('newline')) continue;

      if (!comma) this.accept(',');
      id = this.accept('ident') || this.accept('string');

      if (!id) {
        this.error('expected "ident" or "string", got {peek}');
      }

      hash = id.val.hash;

      this.skipSpacesAndComments();
      this.expect(':');

      val = this.expression();

      obj.setValue(hash, val);
      obj.setKey(hash, id.val);

      comma = this.accept(',');
      this.skipWhitespace();
    }

    return obj;
  }
819047
def parse(node)
      @margins = ParagraphMargins.new(OoxmlSize.new(0.127, :centimeter),
                                      OoxmlSize.new(0.127, :centimeter),
                                      OoxmlSize.new(0.254, :centimeter),
                                      OoxmlSize.new(0.254, :centimeter)).parse(node)
      node.attributes.each do |key, value|
        case key
        when 'wrap'
          @wrap = value.value.to_sym
        when 'anchor'
          @anchor = value_to_symbol(value)
        when 'vert'
          @vertical = value_to_symbol(value)
        when 'numCol'
          @number_columns = value.value.to_i
        when 'spcCol'
          @space_columns = OoxmlSize.new(value.value.to_f, :emu)
        end
      end
      node.xpath('*').each do |node_child|
        case node_child.name
        when 'prstTxWarp'
          @preset_text_warp = PresetTextWarp.new(parent: self).parse(node_child)
        end
      end
      self
    end
1014294
function parseNodeValue(node) {
  const childNodes = node && node.childNodes && [...node.childNodes];
  if (!childNodes) {
    return {};
  }

  // Trying to find and parse CDATA as JSON
  const cdatas = childNodes.filter((childNode) => childNode.nodeName === '#cdata-section');
  if (cdatas && cdatas.length > 0) {
    try {
      return JSON.parse(cdatas[0].data);
    } catch (e) {}
  }

  // Didn't find any CDATA or failed to parse it as JSON
  return childNodes.reduce((previousText, childNode) => {
    let nodeText = '';
    switch (childNode.nodeName) {
      case '#text':
        nodeText = childNode.textContent.trim();
        break;
      case '#cdata-section':
        nodeText = childNode.data;
        break;
    }
    return previousText + nodeText;
  }, '');
}
710875
function extractTextContent (node) {
    var buf = []
    var textContent
    
    switch (node.nodeType) {
      case 1: // Element node such as <p> or <div>
      case 11: // A DocumentFragment node ( a minimal document object that has no parent)
        node = node.firstChild
        while (node) {
          // Type 7 = a ProcessingInstruction of an XML document such as <?xml-stylesheet ... ?> declaration
          // Type 8 = a Comment node
          if (node.nodeType !== 7 && node.nodeType !== 8) {
            textContent = extractTextContent(node)
            
            if (textContent.length > 0 && buf.length > 0) {
              var previousTextContent = buf[buf.length - 1]
              
              if (textContent[0] !== ' ' && previousTextContent.length > 0 && previousTextContent[previousTextContent.length - 1] !== ' ') {
                buf.push(' ')
              }
            }
            
            buf.push(textContent)
          }
          node = node.nextSibling
        }
        return buf.join('')
      default:
        return node.nodeValue
    }
  }
1253025
function parse(text) {
    const ast = remark.parse(text);
    const src = new StructuredSource(text);
    traverse(ast).forEach(function(node) {
        // eslint-disable-next-line no-invalid-this
        if (this.notLeaf) {
            if (node.type) {
                const replacedType = SyntaxMap[node.type];
                if (!replacedType) {
                    debug(`replacedType : ${replacedType} , node.type: ${node.type}`);
                } else {
                    node.type = replacedType;
                }
            }
            // map `range`, `loc` and `raw` to node
            if (node.position) {
                const position = node.position;
                const positionCompensated = {
                    start: { line: position.start.line, column: position.start.column - 1 },
                    end: { line: position.end.line, column: position.end.column - 1 }
                };
                const range = src.locationToRange(positionCompensated);
                node.loc = positionCompensated;
                node.range = range;
                node.raw = text.slice(range[0], range[1]);
                // Compatible for https://github.com/wooorm/unist, but hidden
                Object.defineProperty(node, "position", {
                    enumerable: false,
                    configurable: false,
                    writable: false,
                    value: position
                });
            }
        }
    });
    return ast;
}
261901
def parse(cls, s, schema_only=False):
        
        a = cls()
        a.state = 'comment'
        a.lineno = 1
        for l in s.splitlines():
            a.parseline(l)
            a.lineno += 1
            if schema_only and a.state == 'data':
                # Don't parse data if we're only loading the schema.
                break
        return a
976915
function parseComment (comment) {
  const body = j('[' + comment + ']').nodes()[0].program.body
  const array = body[0].expression
  return array.elements
}
238855
def parse_rst(text: str) -> docutils.nodes.document:
    """"""
    parser = docutils.parsers.rst.Parser()
    components = (docutils.parsers.rst.Parser,)
    settings = docutils.frontend.OptionParser(components=components).get_default_values()
    document = docutils.utils.new_document('<rst-doc>', settings=settings)
    parser.parse(text, document)
    return document
783371
function parse (node, self) {
  let block = false

  if (node.nodeType === 3) {
    let delimiters = self.templateDelimiters

    if (delimiters) {
      let tokens = parseTemplate(node.data, delimiters)

      if (tokens.length) {
        if (!(tokens.length === 1 && tokens[0].type === 0)) {
          tokens.forEach((token, i) => {
            let text = document.createTextNode(token.value)
            node.parentNode.insertBefore(text, node)

            if (token.type === 1) {
              self.buildBinding(TextBinding, text, null, token.value)
            }
          })

          node.parentNode.removeChild(node)
        }
      }
    }
  } else if (node.nodeType === 1) {
    block = self.traverse(node)
  }

  if (!block) {
    Array.prototype.slice.call(node.childNodes).forEach(function (node) { parse(node, self) })
  }
}
941301
def parse
      return nil unless File.file?(@file)

      doc = parse_xml(@file)
      doc.xpath('w:comments/*').each do |node_child|
        case node_child.name
        when 'comment'
          @comments_array << Comment.new(parent: self).parse(node_child)
        end
      end
      self
    end
585370
function(markup, targetdoc) {
		return this.parseToNodes(markup, targetdoc).filter(function(node) {
			return node.nodeType === Node.ELEMENT_NODE;
		});
	}
1113298
def parse(node)
      node.attributes.each do |key, value|
        case key
        when 'gridSpan'
          @grid_span = value.value.to_i
        when 'hMerge'
          @horizontal_merge = value.value.to_i
        when 'vMerge'
          @vertical_merge = value.value.to_i
        end
      end

      node.xpath('*').each do |node_child|
        case node_child.name
        when 'txBody'
          @text_body = TextBody.new(parent: self).parse(node_child)
        when 'tcPr'
          @properties = CellProperties.new(parent: self).parse(node_child)
        when 'p'
          @elements << DocumentStructure.default_table_paragraph_style.dup.parse(node_child,
                                                                                 0,
                                                                                 DocumentStructure.default_table_run_style,
                                                                                 parent: self)
        when 'sdt'
          @elements << StructuredDocumentTag.new(parent: self).parse(node_child)
        when 'tbl'
          @elements << Table.new(parent: self).parse(node_child)
        end
      end
      self
    end
110936
def parse_header
      s0 = @current_pos
      parse_comments
      if match_str("$") != :failed
        s4 = match_regexp(/^[^:]/)
        if s4 != :failed
          s3 = []
          while s4 != :failed
            s3 << s4
            s4 = match_regexp(/^[^:]/)
          end
        else
          s3 = :failed
        end
        if s3 != :failed
          if match_str(":") != :failed
            s4 = parse_nonls
            if parse_nl != :failed
              @reported_pos = s0
              s0 = { "k" => s3.join, "v" => s4.join }
            else
              @current_pos = s0
              s0 = :failed
            end
          else
            @current_pos = s0
            s0 = :failed
          end
        else
          @current_pos = s0
          s0 = :failed
        end
      else
        @current_pos = s0
        s0 = :failed
      end
      s0
    end