Visit declarations and apply functions.

@param {Array} declarations
@param {Object} functions
@param {RegExp} functionMatcher
@param {Boolean} [parseArgs]
@api private
181516
function func(declarations, functions, functionMatcher, parseArgs) {
  if (!declarations) return;
  if (false !== parseArgs) parseArgs = true;

  declarations.forEach(function(decl){
    if ('comment' == decl.type) return;
    var generatedFuncs = [], result, generatedFunc;

    while (decl.value.match(functionMatcher)) {
      decl.value = decl.value.replace(functionMatcher, function(_, name, args){
        if (parseArgs) {
          args = args.split(/\s*,\s*/).map(strip);
        } else {
          args = [strip(args)];
        }
        // Ensure result is string
        result = '' + functions[name].apply(decl, args);

        // Prevent fall into infinite loop like this:
        //
        // {
        //   url: function(path) {
        //     return 'url(' + '/some/prefix' + path + ')'
        //   }
        // }
        //
        generatedFunc = {from: name, to: name + getRandomString()};
        result = result.replace(functionMatcherBuilder(name), generatedFunc.to + '($2)');
        generatedFuncs.push(generatedFunc);
        return result;
      });
    }

    generatedFuncs.forEach(function(func) {
      decl.value = decl.value.replace(func.to, func.from);
    })
  });
}
732305
public void setMatchedTokens(FSArray v) {
    if (DictTerm_Type.featOkTst && ((DictTerm_Type)jcasType).casFeat_matchedTokens == null)
      jcasType.jcas.throwFeatMissing("matchedTokens", "org.apache.uima.conceptMapper.DictTerm");
    jcasType.ll_cas.ll_setRefValue(addr, ((DictTerm_Type)jcasType).casFeatCode_matchedTokens, jcasType.ll_cas.ll_getFSRef(v));}
500363
function parseFunctionSourceElements() {
        var sourceElement, sourceElements = [], token, directive, firstRestricted, oldLabelSet, oldInIteration, oldInSwitch, oldInFunctionBody;

        expect('{');

        while (index < length) {
            token = lookahead();
            if (token.type !== Token.StringLiteral) {
                break;
            }

            sourceElement = parseSourceElement();
            sourceElements.push(sourceElement);
            if (sourceElement.expression.type !== Syntax.Literal) {
                // this is not directive
                break;
            }
            directive = sliceSource(token.range[0] + 1, token.range[1] - 1);
            if (directive === 'use strict') {
                strict = true;
                if (firstRestricted) {
                    throwError(firstRestricted, Messages.StrictOctalLiteral);
                }
            } else {
                if (!firstRestricted && token.octal) {
                    firstRestricted = token;
                }
            }
        }

        oldLabelSet = labelSet;
        oldInIteration = inIteration;
        oldInSwitch = inSwitch;
        oldInFunctionBody = inFunctionBody;

        labelSet = {};
        inIteration = false;
        inSwitch = false;
        inFunctionBody = true;

        while (index < length) {
            if (match('}')) {
                break;
            }
            sourceElement = parseSourceElement();
            if (typeof sourceElement === 'undefined') {
                break;
            }
            sourceElements.push(sourceElement);
        }

        expect('}');

        labelSet = oldLabelSet;
        inIteration = oldInIteration;
        inSwitch = oldInSwitch;
        inFunctionBody = oldInFunctionBody;

        return {
            type: Syntax.BlockStatement,
            body: wrapBlock(sourceElements)
        };
    }
668983
public void setFunctions(java.util.Collection<String> functions) {
        if (functions == null) {
            this.functions = null;
            return;
        }

        this.functions = new java.util.ArrayList<String>(functions);
    }
744838
private static boolean functionMatches(FunctionDescriptor existingFd,
                                           Type returnType,
                                           Type[] parameterTypes) {
        if (returnType != existingFd.m_type) {
            return false;
        }
        if (parameterTypes.length != existingFd.m_paramTypes.length) {
            return false;
        }
        for (int idx = 0; idx < parameterTypes.length; idx++) {
            if (parameterTypes[idx] != existingFd.m_paramTypes[idx]) {
                return false;
            }
        }
        return true;
    }
1054937
function PARENS(nodetype, func) {
          if (Array.isArray(nodetype)) {
              nodetype.forEach(function(nodetype) {
                  PARENS(nodetype, func);
              });
          } else {
              nodetype.DEFMETHOD("needs_parens", func);
          }
      }
1269983
function parseDeclaraion (declaration) {
    const keyRegexp = /(?:\$)([\w-]+)(?:[\s\n\r\t])*(?::)/;
    const valueRegexp = /(?::)(?:[\s\n\r\t])*(.+)(?:[\s\n\r\t])*(?:;)/;

    const matchKey = declaration.match(keyRegexp);
    const key = matchKey[1].trim();

    const matchValue = declaration.match(valueRegexp);
    const value = matchValue[1].trim();

    return { key, value };
}
1153929
def parse(self, declaration):
        
        declaration = declaration.strip()
        for regex, constructor in self._compiled:
            m = regex.match(declaration)
            if m:
                return constructor(*m.groups())
        raise ValueError('Unable to parse type declaration', declaration)
681941
function declaration() {
        match(/^([;\s]*)+/); // ignore empty declarations + whitespace

        const comment_regexp = /\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;
        let prop = match(/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);

        if (!prop) {
            return;
        }

        prop = prop[0].trim();

        if (!match(/^:\s*/)) {
            return error('property missing \':\'');
        }

        // Quotes regex repeats verbatim inside and outside parentheses
        const val = match(/^((?:\/\*.*?\*\/|'(?:\\'|.)*?'|"(?:\\"|.)*?"|\((\s*'(?:\\'|.)*?'|"(?:\\"|.)*?"|[^)]*?)\s*\)|[^};])+)/);
        const ret = {
            type    : 'declaration',
            property: prop.replace(comment_regexp, ''),
            value   : val ? val[0].replace(comment_regexp, '').trim() : ''
        };

        match(/^[;\s]*/);

        return ret;
    }
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;
        }
    }
831950
public List<FunctionWrapper> compileFunctions(
      ImportStack importStack, Context context, Object object
  ) {
    Class<?> functionClass = object.getClass();
    Method[] methods = functionClass.getDeclaredMethods();
    List<FunctionDeclaration> declarations = new LinkedList<>();

    for (Method method : methods) {
      int modifiers = method.getModifiers();

      if (!Modifier.isPublic(modifiers)) {
        continue;
      }

      FunctionDeclaration declaration = createDeclaration(importStack, context, object, method);
      declarations.add(declaration);
    }

    return declarations.stream().map(FunctionWrapper::new).collect(Collectors.toList());
  }
5646
function Matcher(matchFunc, toString) {
    this.match = function(expression) {
        // Save/restore marks to ensure that failed matches always restore
        // the original location in the expression.
        var result;
        expression.mark();
        result = matchFunc(expression);
        if (result) {
            expression.drop();
        } else {
            expression.restore();
        }
        return result;
    };
    this.toString = typeof toString === "function" ? toString : function() {
        return toString;
    };
}
277502
public void setFunctions(java.util.Collection<FunctionConfiguration> functions) {
        if (functions == null) {
            this.functions = null;
            return;
        }

        this.functions = new com.amazonaws.internal.SdkInternalList<FunctionConfiguration>(functions);
    }
269633
public void addFunctions(final FunctionSet functions) {
    checkNotNull(functions);
    log.debug("Adding functions: {}", functions);

    Object target = functions.target();
    for (String name : functions.names()) {
      addCommand(null, target, name);
    }
  }
844900
private void processFunctions(String name, String text, String type,
      List<MtasCRMParserFunctionOutput> functionOutputList) {
    if (functions.containsKey(type) && functions.get(type).containsKey(name)
        && text != null) {
      MtasCRMParserFunction function = functions.get(type).get(name);
      String[] value;
      if (function.split != null) {
        value = text.split(Pattern.quote(function.split));
      } else {
        value = new String[] { text };
      }
      for (int c = 0; c < value.length; c++) {
        boolean checkedEmpty = false;
        if (value[c].equals("")) {
          checkedEmpty = true;
        }
        if (function.output.containsKey(value[c])) {
          ArrayList<MtasCRMParserFunctionOutput> list = function.output
              .get(value[c]);
          for (MtasCRMParserFunctionOutput listItem : list) {
            functionOutputList.add(listItem.create(value[c]));
          }
        }
        if (!checkedEmpty && function.output.containsKey("")) {
          ArrayList<MtasCRMParserFunctionOutput> list = function.output.get("");
          for (MtasCRMParserFunctionOutput listItem : list) {
            functionOutputList.add(listItem.create(value[c]));
          }
        }
      }
    }
  }
115661
function createFunctionRule(
  words: string[],
  tokenName: string
): ParserContext => ?Token {
  const map = util.createHashMap(words, functionBoundary, false);
  return function(context: ParserContext): ?Token {
    // must be right after a "("
    const token = util.getPreviousNonWsToken(
      context.getAllTokens(),
      context.count()
    );
    if (!token) return null;

    if (
      token.name !== "punctuation" ||
      (token.value !== "(" &&
        (token.name !== "operator" || token.value !== "#'"))
    )
      return null;

    return util.matchWord(context, map, tokenName);
  };
}
948222
function flow (functions) {
  if (!functions.length) {
    return function (arg) { return arg }
  }

  return function () {
    var result = functions[0].apply(this, arguments)
    for (var i = 1; i < functions.length; i++) {
      result = functions[i](result)
    }
    return result
  }
}