parser-state: fix attribute merging
Motivation
Fixes #11268.
Context
This should be non-breaking. As a side effect, it makes some duplicate attribute error messages nicer (later occurrences point back to previous occurrences rather than the other way around).
I'm working at the edge of my proficiency with C++ here, so please take extra care to verify that how I'm handling pointers and memory management is sensible, because I'm not confident that I'm doing it right.
Priorities and Process
Add :+1: to pull requests you find important.
The Nix maintainer team uses a GitHub project board to schedule and track reviews.
This pull request has been mentioned on NixOS Discourse. There might be relevant details there:
https://discourse.nixos.org/t/2024-08-19-nix-team-meeting-minutes-170/50942/1
Eelco has the week off. He'll review this later.
@edolstra is back afaik.
@rhendric Can you resolve the merge conflict? Thanks!
I rebased. There was no actual merge conflict.