Adds a function to the end of the token list
@param function Function which is to be added
@return The new Token created around function
965107
public Token add( Function function ) {
        Token t = new Token(function);
        push( t );
        return t;
    }
907641
public static <T, U> ToLongBiFunction<T, U> toLongBiFunction(CheckedToLongBiFunction<T, U> function) {
        return Unchecked.toLongBiFunction(function, Unchecked.RETHROW_ALL);
    }
1260597
public static <T> ToLongFunction<T> toLongFunction(CheckedToLongFunction<T> function) {
        return Unchecked.toLongFunction(function, Unchecked.RETHROW_ALL);
    }
938374
public void addFunction(Define function) {
		String fn = function.getFunctionName();
		if (functionMap.containsKey(fn)) {
			Define previous = functionMap.get(fn);
			throw new ParseException(
				"Template function \"" + fn + "\" already defined in " + 
				getAlreadyDefinedLocation(previous.getLocation()),
				function.getLocation()
			);
		}
		functionMap.put(fn, function);
	}
1203415
public static String[] getParameters(String function){
        if(function==null){return new String[]{};}
        function = function.substring(function.indexOf("(",5)+1, function.indexOf(")",1));
        return function.split(",");
    }
1327056
public static <R> IntFunction<R> intFunction(CheckedIntFunction<R> function) {
        return Unchecked.intFunction(function, Unchecked.RETHROW_ALL);
    }
815033
public static String collectCodePoint(String string, CodePointFunction function)
    {
        int size = string.length();
        StringBuilder builder = new StringBuilder(size);
        for (int i = 0; i < size; )
        {
            int codePoint = string.codePointAt(i);
            builder.appendCodePoint(function.valueOf(codePoint));
            i += Character.charCount(codePoint);
        }
        return builder.toString();
    }
476705
public static <T, R> Function<T, R> wrap(final Function<T, R> function)
	{
		final Tracing tracing = Tracing.get();

		final String traceId = tracing.newOperationId();
		return wrap(traceId, tracing.isVerbose(), function);
	}
1204279
function addFunctionCallIndent(node) {
            let openingParen;

            if (node.arguments.length) {
                openingParen = sourceCode.getFirstTokenBetween(node.callee, node.arguments[0], astUtils.isOpeningParenToken);
            } else {
                openingParen = sourceCode.getLastToken(node, 1);
            }
            const closingParen = sourceCode.getLastToken(node);

            parameterParens.add(openingParen);
            parameterParens.add(closingParen);
            offsets.setDesiredOffset(openingParen, sourceCode.getTokenBefore(openingParen), 0);

            addElementListIndent(node.arguments, openingParen, closingParen, options.CallExpression.arguments);
        }
1359572
public static <T, F> Function<F, T> bind(final Function<F, T> function) {
        return new Function<F, T>() {
            @Override
            public T apply(F arg) {
                return function.apply(arg);
            }
        };
    }
311457
public <R> Choice<R> transform(final Function<? super T, R> function) {
    checkNotNull(function);
    final Choice<T> thisChoice = this;
    return new Choice<R>() {
      @Override
      protected Iterator<R> iterator() {
        return Iterators.transform(thisChoice.iterator(), function);
      }
    };
  }
861133
function getFunctionsList() {
  const type = NodeType.FunctionsListType;
  const token = tokens[pos];
  const line = token.ln;
  const column = token.col;
  const content = [getFunction()];
  const end = getLastPosition(content, line, column, 3);

  // Skip `...`.
  pos += 3;

  return newNode(type, content, line, column, end);
}
735584
void insertFunctionsAndVariables(TokenList tokens ) {
        TokenList.Token t = tokens.getFirst();
        while( t != null ) {
            if( t.getType() == Type.WORD ) {
                Variable v = lookupVariable(t.word);
                if (v != null) {
                    t.variable = v;
                    t.word = null;
                } else if (functions.isFunctionName(t.word)) {
                    t.function = (new Function(t.word));
                    t.word = null;
                }
            }
            t = t.next;
        }
    }
993312
def register(tag, end_tag=None):
    

    def register_function(function):
        tagmap[tag] = {'func': function, 'endtag': end_tag}
        if end_tag:
            tagmap['endtags'].append(end_tag)
        return function

    return register_function
388890
AppendableExpression appendLoggingFunctionInvocation(
      String functionName,
      String placeholderValue,
      List<SoyExpression> args,
      List<Expression> escapingDirectives) {
    return withNewDelegate(
        delegate.invoke(
            APPEND_LOGGING_FUNCTION_INVOCATION,
            LOGGING_FUNCTION_INVOCATION_CREATE.invoke(
                constant(functionName),
                constant(placeholderValue),
                SoyExpression.asBoxedList(args)),
            BytecodeUtils.asImmutableList(escapingDirectives)),
        true);
  }
181211
static
	public void putFunction(String name, Function function){
		FunctionRegistry.functions.put(Objects.requireNonNull(name), function);
	}
766639
public static String getFunctionParams( String function ) {
      return RegexpUtils.getMatcher( FUNCTION_PARAMS_PATTERN, true ).getGroupIfMatches( function, 1 );
   }