@param \DOMNode $baseNode
@param string $property
@param string|NodeList|\DOMNode|callable $input
@param string|NodeList|\DOMNode|callable $selector
@param int $matchType

@return NodeList
775681
protected function _buildNodeListUntil(\DOMNode $baseNode, string $property, $input = null, $selector = null, int $matchType = null): NodeList {
        $resultNodes = $this->newNodeList();

        // Get our first node
        $node = $baseNode->$property;

        // Keep looping until we are out of nodes.
        // Allow either FIRST to reach \DOMDocument. Others that return multiple should ignore it.
        while ($node instanceof \DOMNode && ($matchType === self::$MATCH_TYPE_FIRST || !($node instanceof \DOMDocument))) {
            // Filter nodes if not matching last
            if ($matchType != self::$MATCH_TYPE_LAST && (is_null($selector) || $node->is($selector))) {
                $resultNodes[] = $node;
            }

            // 'Until' check or first match only
            if ($matchType == self::$MATCH_TYPE_FIRST || (!is_null($input) && $node->is($input))) {
                // Set last match
                if ($matchType == self::$MATCH_TYPE_LAST) {
                    $resultNodes[] = $node;
                }

                break;
            }

            // Find the next node
            $node = $node->{$property};
        }

        return $resultNodes;
    }
375938
public static function fromSelector($selector, Node $parent = null, array $children = null)
    {

        $selector = $selector instanceof Selector ? $selector : Selector::fromString($selector);

        $tag = $selector->getTag();
        $el = new static($tag ? $tag : 'div', $selector->getAttributes(), $parent, $children);

        if ($id = $selector->getId())
            $el->setId($id);

        if ($classes = $selector->getClasses())
            foreach ($classes as $class)
                $el->appendClass($class);

        return $el;
    }
1132691
private function loadType(\DOMXPath $xpath, \DOMNode $node, &$tags)
    {
        $result = $this->loadValues($xpath, $node, ['name']);

        $result['meta'] = $this->loadMeta($xpath, $node);

        $propertiesNode = $xpath->query('x:properties', $node)->item(0);
        $result['properties'] = $this->loadProperties($tags, $xpath, $propertiesNode);

        return $result;
    }
1092771
public function convert(NodeType $nodeType, $propertyName, $rawValue, Context $context)
    {
        $propertyType = $nodeType->getPropertyType($propertyName);

        switch ($propertyType) {
            case 'string':
                return $rawValue;

            case 'reference':
                return $this->convertReference($rawValue, $context);

            case 'references':
                return $this->convertReferences($rawValue, $context);

            case 'DateTime':
                return $this->convertDateTime($rawValue);

            case 'integer':
                return $this->convertInteger($rawValue);

            case 'boolean':
                return $this->convertBoolean($rawValue);

            case 'array':
                return $this->convertArray($rawValue);

            default:
                $innerType = $propertyType;
                if ($propertyType !== null) {
                    try {
                        $parsedType = TypeHandling::parseType($propertyType);
                        $innerType = $parsedType['elementType'] ?: $parsedType['type'];
                    } catch (InvalidTypeException $exception) {
                    }
                }

                if ((is_string($rawValue) || is_array($rawValue)) && $this->objectManager->isRegistered($innerType) && $rawValue !== '') {
                    $propertyMappingConfiguration = new MvcPropertyMappingConfiguration();
                    $propertyMappingConfiguration->allowOverrideTargetType();
                    $propertyMappingConfiguration->allowAllProperties();
                    $propertyMappingConfiguration->skipUnknownProperties();
                    $propertyMappingConfiguration->setTypeConverterOption(PersistentObjectConverter::class, PersistentObjectConverter::CONFIGURATION_MODIFICATION_ALLOWED, true);
                    $propertyMappingConfiguration->setTypeConverterOption(PersistentObjectConverter::class, PersistentObjectConverter::CONFIGURATION_CREATION_ALLOWED, true);

                    return $this->propertyMapper->convert($rawValue, $propertyType, $propertyMappingConfiguration);
                } else {
                    return $rawValue;
                }
        }
    }
1068519
protected Element[] getElements(Element base, String childTag) {
		NodeList nodeList = base.getElementsByTagName(childTag);
		if (nodeList.getLength() == 0) {
			return null;
		}
		Element[] elements = new Element[nodeList.getLength()];
		for (int i=0; i<nodeList.getLength(); i++) {
		    elements[i] = (Element) nodeList.item(i);
		}
		return elements;
	}
10484
private function loadProperty(\DOMXPath $xpath, \DOMNode $node, &$tags)
    {
        $result = $this->loadValues(
            $xpath,
            $node,
            [
                'name',
                'type',
                'minOccurs',
                'maxOccurs',
                'colspan',
                'cssClass',
                'spaceAfter',
                'disabledCondition',
                'visibleCondition',
            ]
        );

        $result['mandatory'] = $this->getValueFromXPath('@mandatory', $xpath, $node, false);
        $result['multilingual'] = $this->getValueFromXPath('@multilingual', $xpath, $node, true);
        $result['onInvalid'] = $this->getValueFromXPath('@onInvalid', $xpath, $node);
        $result['tags'] = $this->loadTags($tags, $xpath, $node);
        $result['params'] = $this->loadParams('x:params/x:param', $xpath, $node);
        $result['meta'] = $this->loadMeta($xpath, $node);

        return $result;
    }
27054
function parse_loop(input, customTags) {
    add_tag("default");    
    i = 0;
    while(!input.eos()) {
      if (look(/@class\b/))
        at_class();
      else if (look(/@extends?\b/))
        at_extends()
      else if (look(/@inherits?\b/))
        at_inherits()
      else if (look(/@mixins?\b/))
        class_list_at_tag(/@mixins?/, "mixins");
      else if (look(/@alternateClassNames?\b/))
        class_list_at_tag(/@alternateClassNames?/, "alternateClassNames");
      else if (look(/@uses\b/))
        class_list_at_tag(/@uses/, "uses");
      else if (look(/@requires\b/))
        class_list_at_tag(/@requires/, "requires");
      else if (look(/@singleton\b/))
        boolean_at_tag(/@singleton/, "singleton");
      else if (look(/@event\b/))
        at_event();
      else if (look(/@method\b/))
        at_method();
      else if (look(/@constructor\b/))
        at_method(true);
      else if (look(/@attribute\b/))
        at_attribute();
      else if (look(/@binding\b/))
        at_binding();
      else if (look(/@param\b/))
        at_param();
      else if (look(/@returns?\b/))
        at_return();
      else if (look(/@cfg\b/))
        at_cfg();
      else if (look(/@property\b/))
        at_property();
      else if (look(/@type\s/))
        at_type();
      else if (look(/@xtype\b/))
        at_xtype(/@xtype/, "widget");
      else if (look(/@ftype\b/))
        at_xtype(/@ftype/, "feature");
      else if (look(/@ptype\b/))
        at_xtype(/@ptype/, "plugin");
      else if (look(/@member\b/))
        at_member();
      else if (look(/@inherit[dD]oc\b/))
        at_inheritdoc();
      else if (look(/@alias/))
        at_alias();
      else if (look(/@see/))
        at_see();
      else if (look(/@todo/))
        at_todo();
      else if (look(/@link/))
        at_link();
      else if (look(/@var\b/))
        at_var();
      else if (look(/@throws?\b/))
        at_throws();
      else if (look(/@enum\b/))
        at_enum();
      else if (look(/@override\b/))
        at_override();
      else if (look(/@cancelable\b/))
        at_cancelable();
      else if (look(/@author\b/))
        at_author();
      else if (look(/@version\b/))
        at_version();
      else if (look(/@since\b/))
        at_since();
      else if (look(/@deprecated\b/))
        at_deprecated();
      else if (look(/@related\b/))
        at_related();
      else if (look(/@private\b/))
        boolean_at_tag(/@private/, "private");
      else if (look(/@ignore\b/))
        boolean_at_tag(/@ignore/, "ignore");
      else if (look(/@experimental\b/))
        boolean_at_tag(/@experimental/, "experimental");
      else if (look(/@chainable\b/))
        boolean_at_tag(/@chainable/, "chainable");
      else if (look(/@inheritable\b/))
        boolean_at_tag(/@inheritable/, "inheritable");
      else if (look(/@accessor\b/))
        boolean_at_tag(/@accessor/, "accessor");
      else if (look(/@evented\b/))
        boolean_at_tag(/@evented/, "evented");
      else if (look(/@bubbles\b/))
        boolean_at_tag(/@bubbles/, "bubbles");
      else if (look(/@read\-?only\b/))
        boolean_at_tag(/@read\-?only/, "readonly");
      else if (look(/@default_private\b/))
        boolean_at_tag(/@default_private/, "default_private");
      else if (look(/@/)) {
        match(/@/);
        var tagName = look(/\w+/);

        var found = _.find(customTags, function(tag) {
          return RegExp(tag).test(tagName);
        });

        if (found) {
          match(found);
          add_tag(tagName);
          skip_horiz_white();

          if (look(/.*/).length > 0) 
            current_tag["doc"] = strip(match(/.*/)); // no text means it's a boolean
        }
        else {
          // basically, "@" has to be the first dang thing after the *
          // this resolves false positives, like [@read] 
          var currPos = input.pointer();
          input.setPointer(currPos - (tagName.length + 3));
         
          var startingLine = input.peek(tagName.length + 3);
         
          if (!/.@/.test(startingLine)) {
            console.warn("Warning".yellow + ": I found @" + tagName + ", but I'm not sure what it ought to do.");
          }

          input.setPointer(currPos);

          current_tag["doc"] += "@";
        }

      }
      else if (look(/[^@]/)) {
        current_tag["doc"] += match(/[^@]+/);
      }
    }
}
1187153
public function convertFrom($source, $targetType, array $convertedChildProperties = [], PropertyMappingConfigurationInterface $configuration = null)
    {
        if (is_array($source)) {
            $result = [];
            /** @var NodeInterface $node */
            foreach ($source as $node) {
                $result[] = $node->getIdentifier();
            }
        } else {
            if ($source instanceof NodeInterface) {
                $result = $source->getIdentifier();
            } else {
                $result = '';
            }
        }

        return $result;
    }
50752
public static function fromParts( $context, $node, $dataPool, $baseIter )
	{
		$result = new ExprNodeIterator();
		$result->fromExprNodeIteratorParts( $context, $node, $dataPool, $baseIter );
		return $result;
	}
1240883
protected function renderMatcher($matcherKey)
    {
        $renderedMatcher = null;

        if (isset($this->properties[$matcherKey]['__objectType'])) {
            // object type already set, so no need to set it
            $renderedMatcher = $this->runtime->render(
                sprintf('%s/%s', $this->path, $matcherKey)
            );
            return $renderedMatcher;
        } elseif (!is_array($this->properties[$matcherKey])) {
            throw new UnsupportedObjectTypeAtPathException('"Case" Fusion object only supports nested Fusion objects; no simple values.', 1372668062);
        } elseif (isset($this->properties[$matcherKey]['__eelExpression'])) {
            throw new UnsupportedObjectTypeAtPathException('"Case" Fusion object only supports nested Fusion objects; no Eel expressions.', 1372668077);
        } else {
            // No object type has been set, so we're using Neos.Fusion:Matcher as fallback
            $renderedMatcher = $this->runtime->render(
                sprintf('%s/%s<Neos.Fusion:Matcher>', $this->path, $matcherKey)
            );
            return $renderedMatcher;
        }
    }
126229
private function loadProperties(&$tags, \DOMXPath $xpath, \DOMNode $context): array
    {
        $result = [];

        /** @var \DOMElement $node */
        foreach ($xpath->query('x:*', $context) as $node) {
            if ('property' === $node->tagName) {
                $value = $this->loadProperty($xpath, $node, $tags);
                $result[$value['name']] = $value;
            } elseif ('block' === $node->tagName) {
                $value = $this->loadBlock($xpath, $node, $tags);
                $result[$value['name']] = $value;
            } elseif ('section' === $node->tagName) {
                $value = $this->loadSection($xpath, $node, $tags);
                $result[$value['name']] = $value;
            }
        }

        return $result;
    }
1174597
private static <T extends Node> ImmutableList<T> getAllMatchingNodesOfType(
      Node rootSoyNode, final Class<T> classObject, final Predicate<T> filter) {
    final ImmutableList.Builder<T> matchedNodesBuilder = ImmutableList.builder();
    // optimization to avoid navigating into expr trees if we can't possibly match anything
    final boolean exploreExpressions = ExprNode.class.isAssignableFrom(classObject);
    visitAllNodes(
        rootSoyNode,
        new NodeVisitor<Node, VisitDirective>() {
          @Override
          public VisitDirective exec(Node node) {
            if (classObject.isInstance(node)) {
              T typedNode = classObject.cast(node);
              if (filter.test(typedNode)) {
                matchedNodesBuilder.add(typedNode);
              }
            }
            if (!exploreExpressions && node instanceof ExprNode) {
              return VisitDirective.SKIP_CHILDREN;
            }
            return VisitDirective.CONTINUE;
          }
        });
    return matchedNodesBuilder.build();
  }
1042411
public static function fromParts( $context, $nodeTest, $matchSelf, $iter )
	{
		$result = new AncestorNodeIterator();
		$result->fromAxisNodeIteratorParts( $context, $nodeTest, $matchSelf, $iter );
		return $result;
	}
1250062
function expandElementRule (element, selectors = [], originalRule) {
  /** early return if we don't have any selectors */
  if (selectors.length === 0) return []

  let usedProps = []
  let expandedRules = []
  let defaultRules = []

  /** create the base rule */
  const baseRule = originalRule.clone()
  baseRule.selectors = selectors
  baseRule.selector = replaceElementTagMentions(element, baseRule.selector)

  /** create postcss rules for each element rule */
  for (const [ ruleSelector, ruleDecls ] of Object.entries(element.rules)) {
    const isRoot = element.pseudos.root === ruleSelector
    const isDefault = element.defaults.includes(ruleSelector)
    const expandedRule = baseRule.clone()

    /** gather all rules that get decls be default */
    if (isDefault) { defaultRules.push(expandedRule) }

    /** map all the selectors to target this rule selector */
    if (!isRoot) { expandedRule.selectors = expandedRule.selectors.map((selector) => `${selector} ${ruleSelector}`) }

    /** strip any non whitelisted props, run tranforms, gather used props */
    expandedRule.walkDecls((decl) => {
      const matchedRuleDecls = ruleDecls.filter(({ prop }) => prop.test(decl.prop))

      if (matchedRuleDecls.length === 0) { return decl.remove() }

      usedProps.push(decl.prop)
      matchedRuleDecls.forEach(({ transform }) => transform(decl, originalRule))
    })

    expandedRules.push(expandedRule)
  }

  baseRule.walkDecls((decl) => {
    if (!usedProps.includes(decl.prop)) {
      defaultRules.forEach((defaultRule) => defaultRule.prepend(decl.clone()))
    }
  })

  return expandedRules
}
1029379
public function resolvePropertyTypeInfo(Property $property): ?VarTypeInfo
    {
        $types = [];

        $propertyDefault = $property->props[0]->default;
        if ($propertyDefault !== null) {
            $types[] = $this->nodeToStringTypeResolver->resolver($propertyDefault);
        }

        $classNode = $property->getAttribute(AttributeKey::CLASS_NODE);
        if (! $classNode instanceof Class_) {
            throw new ShouldNotHappenException();
        }

        $propertyName = $this->nameResolver->resolve($property);
        if ($propertyName === null) {
            return null;
        }

        /** @var Assign[] $propertyAssignNodes */
        $propertyAssignNodes = $this->betterNodeFinder->find([$classNode], function (Node $node) use (
            $propertyName
        ): bool {
            if ($node instanceof Assign && $node->var instanceof PropertyFetch) {
                // is property match
                return $this->nameResolver->isName($node->var, $propertyName);
            }

            return false;
        });

        foreach ($propertyAssignNodes as $propertyAssignNode) {
            $types = array_merge(
                $types,
                $this->nodeTypeResolver->resolveSingleTypeToStrings($propertyAssignNode->expr)
            );
        }

        $types = array_filter($types);

        return new VarTypeInfo($types, $this->typeAnalyzer, $types, true);
    }
106492
@XmlElementDecl(namespace = "urn:oasis:names:tc:xacml:3.0:core:schema:wd-17", name = "Match")
    public JAXBElement<MatchType> createMatch(MatchType value) {
        return new JAXBElement<MatchType>(_Match_QNAME, MatchType.class, null, value);
    }
134466
function( elem, context, xml ) {
			while ( (elem = elem[ dir ]) ) {
				if ( checkNonElements || elem.nodeType === 1  ) {
					return matcher( elem, context, xml );
				}
			}
		}