functionDeclaration(contract, expression) {
    if (!this.enabled.functions) return;

    let start = 0;
    contract.fnId += 1;

    if (expression.modifiers && expression.modifiers.length){
      for (let modifier of expression.modifiers ){

        // It's possible functions will have modifiers that take string args
        // which contains an open curly brace. Skip ahead...
        if (modifier.range[1] > start){
          start = modifier.range[1];
        }

        // Add modifier branch coverage
        if (
          !this.enabled.modifiers   ||
          expression.isConstructor  ||
          this.modifierWhitelist.includes(modifier.name)
        ) {
          continue;
        }

        this.addNewBranch(contract, modifier);
        this._createInjectionPoint(
          contract,
          modifier.range[0],
          {
            type: 'injectModifier',
            branchId: contract.branchId,
            modifierName: modifier.name,
            fnId: contract.fnId,
            condition: 'pre'
          }
        );
        this._createInjectionPoint(
          contract,
          modifier.range[1] + 1,
          {
            type: 'injectModifier',
            branchId: contract.branchId,
            modifierName: modifier.name,
            fnId: contract.fnId,
            condition: 'post'
          }
        );
      }
    } else {
      start = expression.range[0];
    }

    const startContract = contract.instrumented.slice(0, start);
    const startline = ( startContract.match(/\n/g) || [] ).length + 1;
    const startcol = start - startContract.lastIndexOf('\n') - 1;

    const endlineDelta = contract.instrumented.slice(start).indexOf('{');
    const functionDefinition = contract.instrumented.slice(
      start,
      start + endlineDelta
    );

    contract.fnMap[contract.fnId] = {
      name: expression.isConstructor ? 'constructor' : expression.name,
      line: startline,
      loc: expression.loc
    };

    this._createInjectionPoint(
      contract,
      start + endlineDelta + 1,
      {
        type: 'injectFunction',
        fnId: contract.fnId,
      }
    );
  }
Registers injections for function measurements
@param  {Object} contract   instrumentation target
@param  {Object} expression AST node