public static Matcher functionCall ( final String name ) { return new Matcher ( ) { @ Override public boolean matches ( Node node , NodeMetadata metadata ) { // TODO(mknichel): Handle the case when functions are applied through .call or .apply. return node . isCall ( ) && propertyAccess ( name ) . matches ( node . getFirstChild ( ) , metadata ) ; } } ; }
Returns a Matcher that matches all nodes that are function calls that match the provided name .