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

Move our current Rust-ish printer to the generic printer #1110

Open
W95Psp opened this issue Nov 12, 2024 · 0 comments
Open

Move our current Rust-ish printer to the generic printer #1110

W95Psp opened this issue Nov 12, 2024 · 0 comments
Labels
enhancement New feature or request generic-printer

Comments

@W95Psp
Copy link
Collaborator

W95Psp commented Nov 12, 2024

https://github.com/hacspec/hax/blob/4291b195f4dee2bec5568ee6a0b6fe6a108623fb/engine/lib/print_rust.ml defines a Rust printer for our AST, we should move this implementation to the generic printer.

Currently, this printer does no pretty printing at all itself, but leverages rustfmt to do so. However, this printer outputs not only a string, but a list strings coupled with annotations to link to our AST, so that we can debug the phases in the web debugger.

This rustfmt trick uses re, which is causing problems (see #1106).

The generic printer uses pprint, which allows for easy pretty printing. So we should be able to have a decent output, sufficiently pretty for debugging.

@W95Psp W95Psp changed the title Move our current Rust=ish printer to the generic printer Move our current Rust-ish printer to the generic printer Nov 12, 2024
@W95Psp W95Psp added enhancement New feature or request generic-printer labels Nov 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request generic-printer
Projects
None yet
Development

No branches or pull requests

1 participant