code: function Parser (customKeywordSpec) {
      var keywordSpec = customKeywordSpec || {
          _: [0],
          gettext: [0],
          ngettext: [0, 1]
      };
      var openings = ['<%', '{\\*', '{{'];
      var closures = ['%>', '\\*}', '}}'];
  
      if (typeof keywordSpec !== 'object') {
          throw 'Invalid keyword spec';
      }
  
      this.keywordSpec = keywordSpec;
      this.expressionPattern = new RegExp([
          '(?:' + openings.join('[=-]|') + '[=-]) *',
          '(' + Object.keys(keywordSpec).map(escapeRegExp).join('|') + ')',
          '\\(',
          '([\\s\\S]*?)',
          '\\)',
          ' *(?:' + closures.join('|') + ')'
      ].join(''), 'g');
  }
docs: Constructor
  @param Object keywordSpec An object with keywords as keys and parameter indexes as values