ocaml-ppx / ppxlib

Base library and tools for ppx rewriters
MIT License
246 stars 98 forks source link

Give semantics to reserving attribute namespace with dots #443

Closed ncik-roberts closed 1 year ago

ncik-roberts commented 1 year ago

Resolves #442.

This PR gives different semantics to reserving attribute namespaces that contain dots, like "foo.bar". The previous semantics: reserving this namespace has no effect. The new semantics: reserving this namespaces causes attributes of the form [@foo.bar] or [@foo.bar.*] to be treated as reserved.

This is technically a backward-incompatible change, as existing reservations of "foo.bar" will start to have an effect. But it's hard to imagine anyone actually intending these reservations to have no effect, and I claim the new semantics is a more reasonable way to handle this case.

panglesd commented 1 year ago

Thanks a lot for the PR! I haven't looked at the implementation, but from the description, the change seems an improvement!

Apologies for the very long delay in reviewing. I have very few time to allocate to ppxlib, but I hope to be able to review this week.

pitag-ha commented 1 year ago

PD: I've just added a changelog entry:

Attribute namespaces: Fix semantics of reserving multi-component namespaces (#443, @ncik-roberts)

Let me know if you'd prefer something else.

ncik-roberts commented 1 year ago

Thanks for the review. That changelog entry looks good to me.