-
Notifications
You must be signed in to change notification settings - Fork 98
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
Ast_pattern: add patterns drop and as__ (#310) #313
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR @Kakadu! Adding as__
and exposing drop
seems like a good addition to Ast_pattern
to me.
About the tests: They're a bit tedious to read since the test code and test result are in two different files. What would you think about making [%ppx_expect]
-tests out of them? You can see an example of that e.g. here. What do you think?
I copied your example, and your expect-like executable writes empty file when something is wrong with the test. For example, I changed the output, got empty '.corrected' file, changed back, and got again empty '.corrected' file. So, it is almost impossible to understand what is wrong. Using a clever guess I realized that it should be somehow connected to autoformatting. Indeed, when I added
Could we somehow agree on that PR without me touching an abomination called |
Yes, I agree, that's very annoying. That happens when you don't have any
The reason why we disable ocamlformat for expect test files is that our expect test doesn't respect ocamlformat formatting, so promoting In case you want to give it another try: I'd expect the following to work (you'd simply have to
It's pretty much your second test with one modification: it tests the behavior of If you still really don't want to use the expect test framework, we can find another solution. |
9bf76ee
to
a21fc93
Compare
I managed to rewrite with expect-tests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the improvements! I only have a couple of minor comments about the documentation that I'd like to be addressed before merging (notice that my suggestions aren't formatted).
Signed-off-by: Kakadu <[email protected]>
Signed-off-by: Kakadu <[email protected]>
d88b05d
to
8b6306f
Compare
Co-authored-by: Sonja Heinze <[email protected]> Signed-off-by: Kakadu <[email protected]>
8b6306f
to
e46121f
Compare
@pitag-ha ^^ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the change. LGTM!
CHANGES: - Added `error_extensionf` function to the `Location` module (ocaml-ppx/ppxlib#316, @panglesd) - Ast patterns: add `drop` and `as` patterns (ocaml-ppx/ppxlib#313 by @Kakadu, review by @pitag-ha) - Fixed a bug resulting in disscarded rewriters in the presence of instrumentations, as well as a wrong order of rewriting (ocaml-ppx/ppxlib#296, @panglesd) - Driver: Append the last valid AST to the error in case of located exception when embedding errors (ocaml-ppx/ppxlib#315, @panglesd)
No description provided.