Parses rabin chunker string

@param  {String}   chunker Chunker algorithm supported formats:
"rabin"
"rabin-{avg}"
"rabin-{min}-{avg}-{max}"

@return {Object}   rabin chunker options
558829
function parseRabinString (chunker) {
  const options = {}
  const parts = chunker.split('-')
  switch (parts.length) {
    case 1:
      options.avgChunkSize = 262144
      break
    case 2:
      options.avgChunkSize = parseChunkSize(parts[1], 'avg')
      break
    case 4:
      options.minChunkSize = parseChunkSize(parts[1], 'min')
      options.avgChunkSize = parseChunkSize(parts[2], 'avg')
      options.maxChunkSize = parseChunkSize(parts[3], 'max')
      break
    default:
      throw new Error('Incorrect chunker format (expected "rabin" "rabin-[avg]" or "rabin-[min]-[avg]-[max]"')
  }

  return options
}
939975
function rangeParser (size, str, options) {
  if (typeof str !== 'string') {
    throw new TypeError('argument str must be a string')
  }

  var index = str.indexOf('=')

  if (index === -1) {
    return -2
  }

  // split the range string
  var arr = str.slice(index + 1).split(',')
  var ranges = []

  // add ranges type
  ranges.type = str.slice(0, index)

  // parse all ranges
  for (var i = 0; i < arr.length; i++) {
    var range = arr[i].split('-')
    var start = parseInt(range[0], 10)
    var end = parseInt(range[1], 10)

    // -nnn
    if (isNaN(start)) {
      start = size - end
      end = size - 1
    // nnn-
    } else if (isNaN(end)) {
      end = size - 1
    }

    // limit last-byte-pos to current length
    if (end > size - 1) {
      end = size - 1
    }

    // invalid or unsatisifiable
    if (isNaN(start) || isNaN(end) || start > end || start < 0) {
      continue
    }

    // add range
    ranges.push({
      start: start,
      end: end
    })
  }

  if (ranges.length < 1) {
    // unsatisifiable
    return -1
  }

  return options && options.combine
    ? combineRanges(ranges)
    : ranges
}
55885
function delimiterMutator(input){
	var delimiter=this.ra([' ','\n','<','>','\"','\'',',','.',';','|'])
//	console.log('Delimiter: '+delimiter)
	var chunks=input.split(delimiter)
	var chunk=this.ra(chunks)
	if(chunk.length>5 && chunk.length<300)
		this.storage.storeKeyValuePair([delimiter,chunk],'delimiterMutator')
	var oldChunk=this.storage.getValueForKey(delimiter,'delimiterMutator')
				
	if(chunks.length<3 || chunks.length<input.length/300){
//		console.log('Fail:'+ (chunks.length)+'<'+(input.length/300) )
		return false
	}
	switch(this.rint(3)) {
    case 0:
//    	console.log('Repeat')
    	return chunkRepeat.call(this,chunks,delimiter,oldChunk)
    case 1:
//    	console.log('Swap')
    	return chunkSwap.call(this,chunks,delimiter,oldChunk)
    case 2:
//    	console.log('Move')
    	return chunkMove.call(this,chunks,delimiter)
    default:
        console.log('WTF?')
	}
}
995839
function makeConcat(chunkType) {
	switch (chunkType) {
	case BUFFER:
		return (a, b) => Buffer.concat([a, b]);
	default:
		return (a, b) => {
			// console.log('[%d, %d]', a.length, b.length);
			const t = new Uint8Array(a.length + b.length);
			t.set(a);
			t.set(b, a.length);
			// console.log('%d: %s', t.length, new Buffer(t).toString('utf8'));
			return t;
		};
	}
}
817853
function HeaderParser(cfg) {
  EventEmitter.call(this);

  var self = this;
  this.nread = 0;
  this.maxed = false;
  this.npairs = 0;
  this.maxHeaderPairs = (cfg && typeof cfg.maxHeaderPairs === 'number'
                         ? cfg.maxHeaderPairs
                         : MAX_HEADER_PAIRS);
  this.buffer = '';
  this.header = {};
  this.finished = false;
  this.ss = new StreamSearch(B_DCRLF);
  this.ss.on('info', function(isMatch, data, start, end) {
    if (data && !self.maxed) {
      if (self.nread + (end - start) > MAX_HEADER_SIZE) {
        end = (MAX_HEADER_SIZE - self.nread);
        self.nread = MAX_HEADER_SIZE;
      } else
        self.nread += (end - start);

      if (self.nread === MAX_HEADER_SIZE)
        self.maxed = true;

      self.buffer += data.toString('binary', start, end);
    }
    if (isMatch)
      self._finish();
  });
}
71790
function parse (str, options) {
  var tokens = []
  var key = 0
  var index = 0
  var path = ''
  var defaultDelimiter = (options && options.delimiter) || DEFAULT_DELIMITER
  var delimiters = (options && options.delimiters) || DEFAULT_DELIMITERS
  var pathEscaped = false
  var res

  while ((res = PATH_REGEXP.exec(str)) !== null) {
    var m = res[0]
    var escaped = res[1]
    var offset = res.index
    path += str.slice(index, offset)
    index = offset + m.length

    // Ignore already escaped sequences.
    if (escaped) {
      path += escaped[1]
      pathEscaped = true
      continue
    }

    var prev = ''
    var next = str[index]
    var name = res[2]
    var capture = res[3]
    var group = res[4]
    var modifier = res[5]

    if (!pathEscaped && path.length) {
      var k = path.length - 1

      if (delimiters.indexOf(path[k]) > -1) {
        prev = path[k]
        path = path.slice(0, k)
      }
    }

    // Push the current path onto the tokens.
    if (path) {
      tokens.push(path)
      path = ''
      pathEscaped = false
    }

    var partial = prev !== '' && next !== undefined && next !== prev
    var repeat = modifier === '+' || modifier === '*'
    var optional = modifier === '?' || modifier === '*'
    var delimiter = prev || defaultDelimiter
    var pattern = capture || group

    tokens.push({
      name: name || key++,
      prefix: prev,
      delimiter: delimiter,
      optional: optional,
      repeat: repeat,
      partial: partial,
      pattern: pattern ? escapeGroup(pattern) : '[^' + escapeString(delimiter) + ']+?'
    })
  }

  // Push any remaining characters.
  if (path || index < str.length) {
    tokens.push(path + str.substr(index))
  }

  return tokens
}
477691
function parse (str, options) {
  if (typeof str !== 'string') throw new TypeError('str is required!');

  var splitData = split(str);
  var raw = splitData.data;

  if (!raw) return { _content: str };

  var data;

  data = parseYAML(raw, options);

  if (!data) return { _content: str };

  data._content = splitData.content;

  return data;
}
681879
function parse (str, options) {
  var tokens = [];
  var key = 0;
  var index = 0;
  var path = '';
  var defaultDelimiter = options && options.delimiter || '/';
  var res;

  while ((res = PATH_REGEXP.exec(str)) != null) {
    var m = res[0];
    var escaped = res[1];
    var offset = res.index;
    path += str.slice(index, offset);
    index = offset + m.length;

    // Ignore already escaped sequences.
    if (escaped) {
      path += escaped[1];
      continue
    }

    var next = str[index];
    var prefix = res[2];
    var name = res[3];
    var capture = res[4];
    var group = res[5];
    var modifier = res[6];
    var asterisk = res[7];

    // Push the current path onto the tokens.
    if (path) {
      tokens.push(path);
      path = '';
    }

    var partial = prefix != null && next != null && next !== prefix;
    var repeat = modifier === '+' || modifier === '*';
    var optional = modifier === '?' || modifier === '*';
    var delimiter = res[2] || defaultDelimiter;
    var pattern = capture || group;

    tokens.push({
      name: name || key++,
      prefix: prefix || '',
      delimiter: delimiter,
      optional: optional,
      repeat: repeat,
      partial: partial,
      asterisk: !!asterisk,
      pattern: pattern ? escapeGroup(pattern) : (asterisk ? '.*' : '[^' + escapeString(delimiter) + ']+?')
    });
  }

  // Match any characters still remaining.
  if (index < str.length) {
    path += str.substr(index);
  }

  // If the path exists, push it onto the end.
  if (path) {
    tokens.push(path);
  }

  return tokens
}
1064483
function parseCodeChunkToAST(src, options) {
    src = src
    .replace(/@/g, '\uFFDA')
    .replace(/#/g, '\uFFDB')
    ;
    var ast = recast.parse(src);
    return ast;
}
999657
function parse(string) {

    var buffer = newBufferFromSize(16);
    var j = 0;
    for (var i = 0; i < 16; i++) {
        buffer[i] = hex2byte[string[j++] + string[j++]];
        if (i === 3 || i === 5 || i === 7 || i === 9) {
            j += 1;
        }
    }

    return buffer;
}
156680
function Decoder(options) {
  options = options || {};
  Transform.call(this, {});

  this._reset();

  // maximum length for bulk strings (512MB)
  this.maxlen = options.maxlen || 536870912;

  // create String instances for simple string replies
  this.simple = options.simple !== undefined ? options.simple : false;

  // return buffers for bulk strings
  this.buffers = options.return_buffers || options.buffers;

  // pass RESP messasges untouched
  this.raw = options.raw !== undefined ? options.raw : false;

  /* istanbul ignore next: optional dependency */
  if(hiredis) {
    this.reader = new hiredis.Reader({return_buffers: this.buffers});
  }

}
651242
function parse(str, options = {}) {
    let tokens = tokenize(str)
    let data = []

    tokens.forEach((item, idx) => {
        let [ label, token ] = item
        if (renderRules[label]) {
            data.push(renderRules[label](token))
        }else {
            data.push([ RENDER_TYPE_PLAIN, token ])
        }
    })
    return data
}
1289477
function parseArrayChunks (parser) {
  var arr = parser.arrayCache.pop()
  var pos = parser.arrayPos.pop()
  if (parser.arrayCache.length) {
    const res = parseArrayChunks(parser)
    if (res === undefined) {
      pushArrayCache(parser, arr, pos)
      return
    }
    arr[pos++] = res
  }
  return parseArrayElements(parser, arr, pos)
}
1036577
function getParser(delimiterOrParser) {
  var parser;
  if (typeof delimiterOrParser === 'string') {
    parser = discernParser(delimiterOrParser, { delimiter: true });
  } else if (typeof delimiterOrParser === 'function' || (typeof delimiterOrParser === 'undefined' ? 'undefined' : _typeof(delimiterOrParser)) === 'object') {
    parser = delimiterOrParser;
  }
  return parser;
}
756648
function parse_FileMoniker(blob) {
	blob.l += 2; //var cAnti = blob.read_shift(2);
	var ansiPath = blob.read_shift(0, 'lpstr-ansi');
	blob.l += 2; //var endServer = blob.read_shift(2);
	if(blob.read_shift(2) != 0xDEAD) throw new Error("Bad FileMoniker");
	var sz = blob.read_shift(4);
	if(sz === 0) return ansiPath.replace(/\\/g,"/");
	var bytes = blob.read_shift(4);
	if(blob.read_shift(2) != 3) throw new Error("Bad FileMoniker");
	var unicodePath = blob.read_shift(bytes>>1, 'utf16le').replace(chr0,"");
	return unicodePath;
}
313167
function parse (tmpl) {
  tmpl = tmpl || ''
  const parser = uritemplate.parse(tmpl)

  return function expand (params) {
    params = params || {}
    return parser.expand(params)
  }
}
447358
function parse_ArrayParsedFormula(blob, length, opts) {
	var target = blob.l + length, len = opts.biff == 2 ? 1 : 2;
	var rgcb, cce = blob.read_shift(len); // length of rgce
	if(cce == 0xFFFF) return [[],parsenoop(blob, length-2)];
	var rgce = parse_Rgce(blob, cce, opts);
	if(length !== cce + len) rgcb = parse_RgbExtra(blob, length - cce - len, rgce, opts);
	blob.l = target;
	return [rgce, rgcb];
}