process method

String process()

Implementation

String process() {
  var out = '$code';
  for (var i = 0; i < _replaces.length; i++) {
    var replace = _replaces[i];

    int start = replace[0];
    int len = replace[1];
    String newCode = replace[2];

    out = out.replaceRange(start, start + len, newCode);

    if (newCode.length != len) {
      for (var j = i + 1; j < _replaces.length; j++) {
        _replaces[j][0] += newCode.length - len;
      }
    }
  }
  return out;
}