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

Add option to dump CompileExpr in a standard, parseable format #278

Open
evertedsphere opened this issue Apr 13, 2020 · 2 comments
Open

Comments

@evertedsphere
Copy link

This seems fairly simple, and I intend to add support for this myself. The easiest way, if not the "correct" one, is to add a dummy backend that pretty-prints the CompileExpr it receives to a file.

@chrrasmussen
Copy link
Contributor

I think --dumpcases is what you are looking for. It was added in commit 5950371.

If you have a Main.idr with a main : IO () function, you can use --dumpcases like this:

idris2 --dumpcases foo -o bar Main.idr
  • foo is the name of the file where the CompileExpr will be dumped (located in the current directory)
  • bar is the name of the output executable (located in build/exec)

@evertedsphere
Copy link
Author

I don't think so; I guess I should've mentioned that my use-case requires the output to be easily parseable in a way that the output of --dumpcases is not, so I can use it as an input for further processing.

I discussed this with @edwinb yesterday, and it seems we may want to standardise a stable s-expression-style text format for this.

@evertedsphere evertedsphere changed the title Dump pretty-printed CompileExpr to stdout Add option to dump CompileExpr in a standard, parseable format Apr 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants