-
Notifications
You must be signed in to change notification settings - Fork 8
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
Embed errors in the AST instead of raising #48
Comments
Hello, can i work on this? |
This would be an excellent addition, thank you for taking the time to right a really detailed issue @panglesd :)) Hi @Dezzy12 ! I see no reason why not, thank you for wanting to contribute, let us know if you need any further help or assistance. |
okay thank you. i will get to back to you in case i need some assistance |
hi @patricoferris I opened a opened a pull request for this issue, please review |
Note that we decided that we will change the ppxlib behaviour regarding the handling of exceptions. So, the example I gave in the original issue is not relevant any more. An updated example would be that, with embedding, type t = int -> int
and u = int -> int
and v = int [@@deriving yaml]
let _ = v_of_yaml will show errors for both |
Okay thank you |
CHANGES: - Embed errors in the AST (patricoferris/ppx_deriving_yaml#51, @patricoferris and special thanks to @panglesd for the detailed issue in patricoferris/ppx_deriving_yaml#48)
CHANGES: - Embed errors in the AST (patricoferris/ppx_deriving_yaml#51, @patricoferris and special thanks to @panglesd for the detailed issue in patricoferris/ppx_deriving_yaml#48)
CHANGES: - Embed errors in the AST (patricoferris/ppx_deriving_yaml#51, @patricoferris and special thanks to @panglesd for the detailed issue in patricoferris/ppx_deriving_yaml#48)
Currently, when your PPX encounter an error, it uses the
raise_errorf
function to raise a located error.The exception is caught by
ppxlib
, which in this case:[%%%ocaml.error]
extension node) to the last valid astThe interruption of the rewriting is quite bad for the user experience! The implication for the users are:
Example
For instance:
would generate several errors:
t
v_of_yojson
when the correct set of errors would be:
t
u
You can find more information about error reporting in PPXs in this section of the ppxlib manual.
❓ Would you be willing to accept contributions to this issue? I'm considering assigning its resolution as part of an outreachy internship: see more information here.
The text was updated successfully, but these errors were encountered: