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

Make identifiers include the relative path. #411

Open
n-osborne opened this issue Jun 19, 2024 · 0 comments
Open

Make identifiers include the relative path. #411

n-osborne opened this issue Jun 19, 2024 · 0 comments

Comments

@n-osborne
Copy link
Contributor

While working on adding a pretty printer to Gospel, I've stumbled on the fact that I can either print the fully resolved path or just the name of the symbol (Lident in OCaml).

A correct pretty printer should print the symbols the way it is written in the source code in the first place (the relative path).

Also, printing the latter leads to incorrect Gospel code for the symbols defined in another module that is not yet open, while printing the former leads to incorrect Gospel code for symbols defined in the current module (as the fully resolved path contains the name of the said module).

I suggest that identifiers carry, along the newly added fully resolved path, the relative path.

One could also be so bold as to reuse the Longident.t type from the OCaml parsetree!

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

No branches or pull requests

1 participant