Matches an AST node if its type is either a primitive type or a {@code void} type.
178797
public static <T extends Tree> Matcher<T> isPrimitiveOrVoidType() {
    return new Matcher<T>() {
      @Override
      public boolean matches(T t, VisitorState state) {
        Type type = getType(t);
        return type != null && type.isPrimitiveOrVoid();
      }
    };
  }
1171605
function isType(o, typeName) {
        if (!o || !_.isObject(o)) {
            return false;
        }
        try {
            return Tinkerpop.Java.instanceOf(o, typeName);
        }
        catch (err) {
            return false;
        }
    }
357018
function match(node, type) {
            let innerStatementNode = node;

            while (innerStatementNode.type === "LabeledStatement") {
                innerStatementNode = innerStatementNode.body;
            }
            if (Array.isArray(type)) {
                return type.some(match.bind(null, innerStatementNode));
            }
            return StatementTypes[type].test(innerStatementNode, sourceCode);
        }
97157
function isLLCallcode (node) {
  return isMemberAccess(node,
          exactMatch(util.escapeRegExp(lowLevelCallTypes.CALLCODE.type)),
          undefined, exactMatch(basicTypes.ADDRESS), exactMatch(lowLevelCallTypes.CALLCODE.ident))
}
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();
  }
848812
private boolean match(Class<?>[] declaredTypes, Class<?>[] actualTypes) {
        if (declaredTypes.length == actualTypes.length) {
            for (int i = 0; i < actualTypes.length; i++) {
                if (actualTypes[i] == NULL.class)
                    continue;

                if (wrapper(declaredTypes[i]).isAssignableFrom(wrapper(actualTypes[i])))
                    continue;

                return false;
            }

            return true;
        }
        else {
            return false;
        }
    }
1234192
boolean expectObject(Node n, JSType type, String msg) {
    if (!type.matchesObjectContext()) {
      mismatch(n, msg, type, OBJECT_TYPE);
      return false;
    }
    return true;
  }
313813
static boolean isAdapterType(Element element, Elements elements, Types types) {
    TypeMirror typeAdapterType = types.getDeclaredType(
        elements.getTypeElement(TYPE_ADAPTER_CLASS_NAME),
        types.getWildcardType(null, null));
    return types.isAssignable(element.asType(), typeAdapterType);
  }
118256
private Node tryFoldTypeof(Node originalTypeofNode) {
    checkArgument(originalTypeofNode.isTypeOf());

    Node argumentNode = originalTypeofNode.getFirstChild();
    if (argumentNode == null || !NodeUtil.isLiteralValue(argumentNode, true)) {
      return originalTypeofNode;
    }

    String typeNameString = null;

    switch (argumentNode.getToken()) {
      case FUNCTION:
        typeNameString = "function";
        break;
      case STRING:
        typeNameString = "string";
        break;
      case NUMBER:
        typeNameString = "number";
        break;
      case TRUE:
      case FALSE:
        typeNameString = "boolean";
        break;
      case NULL:
      case OBJECTLIT:
      case ARRAYLIT:
        typeNameString = "object";
        break;
      case VOID:
        typeNameString = "undefined";
        break;
      case NAME:
        // We assume here that programs don't change the value of the
        // keyword undefined to something other than the value undefined.
        if ("undefined".equals(argumentNode.getString())) {
          typeNameString = "undefined";
        }
        break;
      default:
        break;
    }

    if (typeNameString != null) {
      Node newNode = IR.string(typeNameString);
      reportChangeToEnclosingScope(originalTypeofNode);
      originalTypeofNode.replaceWith(newNode);
      markFunctionsDeleted(originalTypeofNode);

      return newNode;
    }

    return originalTypeofNode;
  }
132056
function matches (element, selector) {
  if (!element || element.nodeType !== 1) {
    return false
  }
  return nativeMatches.call(element, selector)
}
424830
public boolean matches(final Node node) throws IllegalArgumentException {
        // Precondition checks
        if (node == null) {
            throw new IllegalArgumentException("node must be specified");
        }

        if (!name.equals(node.getName())) {
            return false;
        }

        if ((text != null && node.getText() == null) || (text != null && !text.trim().equals(node.getText().trim()))) {
            return false;
        }

        if (attributes != null) {
            for (final Map.Entry<String, String> attribute : attributes.entrySet()) {
                final String attrValue = attribute.getValue();
                final String attrName = attribute.getKey();

                if (!attrValue.equals(node.getAttribute(attrName))) {
                    return false;
                }
            }
        }

        return true;
    }
479942
protected void findMatching(Class<? extends T> type, BiPredicate<Class<? extends T>, D> predicate)
	{
		traverseType(type, predicate, new HashSet<>());
	}
194968
public boolean matches(final Node node) {
        if (node.getNodeType() == Node.ELEMENT_NODE) {
            return matches(((Element) node).getAttribute(ATTRIBUTE_NAME_CLASS));
        }
        return false;
    }
1066415
public static PrimitiveType checkIsPrimitiveType(Type type) {
        if (!isPrimitiveType(type)) {
            throw new ODataSystemException("A primitive type is required, but '" + type.getFullyQualifiedName() +
                    "' is not a primitive type: " + type.getMetaType());
        }
        return (PrimitiveType) type;
    }
112610
protected <JavaTypeT> TypeCodec<JavaTypeT> codecFor(
      DataType cqlType, GenericType<JavaTypeT> javaType, boolean isJavaCovariant) {
    LOG.trace("[{}] Looking up codec for {} <-> {}", logPrefix, cqlType, javaType);
    TypeCodec<?> primitiveCodec = primitiveCodecsByCode.get(cqlType.getProtocolCode());
    if (primitiveCodec != null && matches(primitiveCodec, javaType, isJavaCovariant)) {
      LOG.trace("[{}] Found matching primitive codec {}", logPrefix, primitiveCodec);
      return uncheckedCast(primitiveCodec);
    }
    for (TypeCodec<?> userCodec : userCodecs) {
      if (userCodec.accepts(cqlType) && matches(userCodec, javaType, isJavaCovariant)) {
        LOG.trace("[{}] Found matching user codec {}", logPrefix, userCodec);
        return uncheckedCast(userCodec);
      }
    }
    return uncheckedCast(getCachedCodec(cqlType, javaType, isJavaCovariant));
  }
897297
function isTypeOf(path, typePath) {
            var node = _getNode(path);

            if (node) {
                return state.core.isTypeOf(node, typePath);
            }

            return false;
        }
251165
public static <T extends TypeDefinition> ElementMatcher.Junction<T> is(Type type) {
        return is(TypeDefinition.Sort.describe(type));
    }