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

Fix source quotation in OCaml 5.2 #480

Merged

Conversation

NathanReb
Copy link
Collaborator

The compiler removed some logic that was reopening the source file based on Location.input_name and instead only rely on Location.input_lexbuf for source quotation.

This PR first adds a test that rely on source quotation. Our test suite failed to catch this bug because all our tests use OCAML_ERROR_STYLE=short.
It then changes the way we read source files to stick to what the compiler does in Pparse while preserving our features such read from stdin. We now set the input_lexbuf properly.

@NathanReb
Copy link
Collaborator Author

See ocaml/ocaml#12991 for context!

The compiler removed some logic that was reopening the source
file based on `Location.input_name` and instead only rely on
`Location.input_lexbuf` for source quotation.

This PR changes the way we read source files to stick to what
the compiler does in `Pparse` while preserving our features
such read from stdin. We now set the input_lexbuf properly.

Signed-off-by: Nathan Rebours <[email protected]>
@NathanReb NathanReb force-pushed the fix-source-quotation-5-2 branch from 379f004 to f938704 Compare March 4, 2024 11:19
Copy link
Collaborator

@panglesd panglesd left a comment

Choose a reason for hiding this comment

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

Looks good to me!

@NathanReb NathanReb merged commit c68ad2c into ocaml-ppx:trunk-support Mar 8, 2024
4 checks passed
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