-
-
Notifications
You must be signed in to change notification settings - Fork 56
ppx: show strange quoted strings transform #863
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
Conversation
71694d7
to
96d0d2c
Compare
Why is this happening?
In both cases, it replaces the original string delimiters with the private Discussion
SolutionsA few alternatives that come to mind:
|
That ^ sentence suggests the Melange PPX could run twice for the same AST node. How could that happen? What does "further processing" mean?
From what I understand, the melange PPX can ran after some other PPXs (like it did in the past) or before other PPXs (as the situation with melange-react-intl shows). So assuming ordering doesn't matter, and assuming the Melange PPX only runs once per AST node, I would vote for option 3: remove the |
thanks for the detailed explanation @anmonteiro
I am wondering in which scenarios the Melange PPX could be run multiple times? |
I don't think this is a good option – re-reading my message, the biggest downside isn't immediately obvious: that strings generated by a PPX in the middle won't be escaped if the melange ppx has already run. This is already currently a problem in any case. If not too invasive, I believe option 1. might actually be the way forward here. |
I don't know if it will in normal situations, but you can always run |
imo we should not make downstream PPX author's life harder because of such an edgy case.
Another option (I guess 5?) would be to expose the functionality of escaping these strings as a library, so that PPXs don't need to rely on ordering if they somehow generate this kind of elements, and can apply that transformation directly. |
We also use the #995 moves the transformation to the compiler core, which a) implements 1. and b) doesn't expose |
96d0d2c
to
224bfa7
Compare
The melange ppx transforms
js
quoted strings into*j
for some reason. This is very confusing for any ppxs authors that want to build upon these quoted strings (like melange-react-intl), because they have to target the*j
one. cc @ixzzd