ppxlib icon indicating copy to clipboard operation
ppxlib copied to clipboard

Improve `Ast_pattern` error reporting.

Open panglesd opened this issue 2 years ago • 9 comments

The error reported by Ast_pattern are not very informative, especially for the user of the PPX, who might not know anything about the AST.

Here is an example of an error generated by an unmatched AST pattern:

Error: PStr expected

Possible improvements:

  • Make a more complete sentence, with more information: Error: a "structure" node was expected, instead of a "..."
  • Allow for custom error message (or custom additional information) in the API. It is especially interesting for the alt function, which only expects from one branch. Example of a custom error message (see https://github.com/ocaml-ppx/ppx_import/pull/87):
Error: [%%import] Type pattern (PTyp) is not supported, only type and module
         type declarations are allowed

panglesd avatar Feb 28 '23 08:02 panglesd

Hello, I'd like to work on this issue Can you please assign it to me?

nangahamandine avatar Mar 15 '23 07:03 nangahamandine

I noticed that on the referenced issue, changes were made in the ocaml-ppx/ppx-import. I've successfully cloned and built ocaml-ppx/ppxlib. Will I need to clone multiple extensions of ocaml-ppx? Or do I stick with ppxlib for now?

nangahamandine avatar Mar 15 '23 08:03 nangahamandine

Hello @nangahamandine, I think for this issue you will need just the ppxlib

Burnleydev1 avatar Mar 15 '23 08:03 Burnleydev1

Sure, thanks

nangahamandine avatar Mar 15 '23 08:03 nangahamandine

Hi @nangahamandine, I wish to find out if you've completed this issue already!

marrious11 avatar Mar 18 '23 05:03 marrious11

hey! I am an outreachy applicant, I would like to work on this issue. can you please assign it to me?

meghaaa30 avatar Mar 21 '23 11:03 meghaaa30

@nangahamandine are you still actively working on this issue? @marrious11 have you started working on it, or do you still want to?

Do not hesitate to ask for support, or precision on the task. But let us know if the issue can be assigned to someone else!

If this issue is already taken, there are others with still no-one working on them, listed on #389.

panglesd avatar Mar 21 '23 11:03 panglesd

Well, sir @panglesd, I'd hoped to but since I meet a comment on it from @nangahamandine, I thought she has been reading through, and perhaps working on it too: But I also started working on it in my own small way though. We could work on it together if it is okay by you sir!

marrious11 avatar Mar 22 '23 11:03 marrious11

I've not been able to do much. My time commitments changed so I've had little to no time to make changes or contributions Please go ahead and work on the issue Good luck!

nangahamandine avatar Mar 22 '23 13:03 nangahamandine