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

Json dumping functions for debugging #848

Merged
merged 1 commit into from
Aug 21, 2024

Conversation

elegios
Copy link
Contributor

@elegios elegios commented May 29, 2024

I found during development of the reptypes stuff that it was convenient to dump lots of data as json, then explore with, e.g., jless or jq, so I figured it'd be useful to have similar tools available for mexpr in general (and it was in fact useful to debug some lambda-lifting issues). This PR thus adds a basic module that just dumps everything in the AST. There's no place in the compiler (or any of the dependent projects) that uses this right now, but it's now a straightforward tool to reach for when you need to explore a large AST and the other tools we have don't really scale.

It also uses the idea of #826 when printing chains of bindings (I did not have time to do the full refactor unfortunately, but updating this library once that is done should be trivial).

Finally, I also changed json.mc so that it escapes all values with codepoints < 32 (i.e., up to and including 1f), since that's apparently required.

@david-broman david-broman merged commit 178f216 into miking-lang:develop Aug 21, 2024
2 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