code: function addLocations(fromLocation, addedLocation) {
    const result = Object.assign(defaultLocation(), fromLocation);
    const added = Object.assign(defaultLocation(), addedLocation);
  
    if (added.line !== 1) {
      result.col = 1;
    }
  
    result.line += added.line - 1;
    result.col += added.col - 1;
    result.startOffset += added.startOffset;
    result.endOffset = result.startOffset + (added.endOffset - added.startOffset);
  
    return result;
  }
docs: "Adds" a location to an initial ("from") location. The rules for this are weird because:  1. `line` and `col` are 1-based, so 1 must be subtracted from the result of adding either. 2. A newline "resets" the "from" column number to 1.  For these reasons, this addition is not commutative.