Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Context_free.map_top_down's embed_errors arg optional #468

Merged
merged 2 commits into from
Feb 2, 2024

Conversation

NathanReb
Copy link
Collaborator

This extra argument that was added in #453 caused breakage in ocsigen-i18n that was using Context_free.map_top_down.

Although it's undocumented, this function is still part of the public API. Adding an extra optional argument is not strictly speaking non-breaking but is good enough of an effort considering the status of this function and in particular, the fact that it only has a single public external user at the moment, for which it does prevent breakage.

CHANGES.md Outdated Show resolved Hide resolved
NathanReb and others added 2 commits February 2, 2024 12:42
This extra argument that was added in ocaml-ppx#453 caused breakage
in `ocsigen-i18n` that was using `Context_free.map_top_down`.
Although it's undocumented, this function is still part of the public
API. Adding an extra optional argument is not strictly speaking
non-breaking but is good enough of an effort considering the status
of this function and in particular, the fact that it only has a single
public external user for which it prevents breakage.

Signed-off-by: Nathan Rebours <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Signed-off-by: Nathan Rebours <[email protected]>
@NathanReb NathanReb force-pushed the fix-map-top-down-api branch from 564e746 to 9887aa4 Compare February 2, 2024 11:43
@NathanReb
Copy link
Collaborator Author

I added a changelog entry in case it does introduce breakage outside opam-repo somewhere, to help users track it down to the next release!

Copy link
Member

@pitag-ha pitag-ha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for noticing the breakage during the release and for the quick fix!

@NathanReb NathanReb merged commit 86165c6 into ocaml-ppx:main Feb 2, 2024
4 of 5 checks passed
NathanReb added a commit to NathanReb/opam-repository that referenced this pull request Feb 5, 2024
CHANGES:

- Add an optional `embed_errors` argument to `Context_free.map_top_down` that
  controls how to deal with exceptions thrown by context-free rules.
  (ocaml-ppx/ppxlib#468, @NathanReb)

- Fix `Longident.parse` so it properly handles unparenthesized dotted operators
  such as `+.` or `*.`. (ocaml-ppx/ppxlib#111, @rgrinberg, @NathanReb)

- raising an exception does no longer cancel the whole context free phase(ocaml-ppx/ppxlib#453, @Burnleydev1)

- Sort embedded errors that are appended to the AST by location so the compiler
  reports the one closer to the beginning of the file first. (ocaml-ppx/ppxlib#463, @NathanReb)

- Update `Attribute.get` to ignore `loc_ghost`. (ocaml-ppx/ppxlib#460, @ceastlund)

- Add API to manipulate attributes that are used as flags (ocaml-ppx/ppxlib#408, @dianaoigo)

- Update changelog to use ISO 8061 date format: YYYY-MM-DD. (ocaml-ppx/ppxlib#445, @ceastlund)

- Replace `Caml` with `Stdlib`. (ocaml-ppx/ppxlib#427, @ceastlund)

- When a transformation raises, the last valid AST is used as input to the upcoming
  transformations. All such errors are collected and appended as
  extension nodes to the final AST (ocaml-ppx/ppxlib#447, @Burnleydev1)

- Fix a small mistake in the man pages: Embededding errors is done by default with
  `-as-pp`, not with `-dump-ast` (ocaml-ppx/ppxlib#464, @pitag-ha)

- Set appropriate binary mode when writing to `stdout` especially for Windows
  compatibility. (ocaml-ppx/ppxlib#466, @jonahbeckford)
nberth pushed a commit to nberth/opam-repository that referenced this pull request Jun 18, 2024
CHANGES:

- Add an optional `embed_errors` argument to `Context_free.map_top_down` that
  controls how to deal with exceptions thrown by context-free rules.
  (ocaml-ppx/ppxlib#468, @NathanReb)

- Fix `Longident.parse` so it properly handles unparenthesized dotted operators
  such as `+.` or `*.`. (ocaml-ppx/ppxlib#111, @rgrinberg, @NathanReb)

- raising an exception does no longer cancel the whole context free phase(ocaml-ppx/ppxlib#453, @Burnleydev1)

- Sort embedded errors that are appended to the AST by location so the compiler
  reports the one closer to the beginning of the file first. (ocaml-ppx/ppxlib#463, @NathanReb)

- Update `Attribute.get` to ignore `loc_ghost`. (ocaml-ppx/ppxlib#460, @ceastlund)

- Add API to manipulate attributes that are used as flags (ocaml-ppx/ppxlib#408, @dianaoigo)

- Update changelog to use ISO 8061 date format: YYYY-MM-DD. (ocaml-ppx/ppxlib#445, @ceastlund)

- Replace `Caml` with `Stdlib`. (ocaml-ppx/ppxlib#427, @ceastlund)

- When a transformation raises, the last valid AST is used as input to the upcoming
  transformations. All such errors are collected and appended as
  extension nodes to the final AST (ocaml-ppx/ppxlib#447, @Burnleydev1)

- Fix a small mistake in the man pages: Embededding errors is done by default with
  `-as-pp`, not with `-dump-ast` (ocaml-ppx/ppxlib#464, @pitag-ha)

- Set appropriate binary mode when writing to `stdout` especially for Windows
  compatibility. (ocaml-ppx/ppxlib#466, @jonahbeckford)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants