source map: remove duplicates and add loc.end