Option --dump-coreimp#3094
Closed
metaleap wants to merge 2 commits intopurescript:masterfrom
metaleap:master
Closed
Option --dump-coreimp#3094metaleap wants to merge 2 commits intopurescript:masterfrom metaleap:master
metaleap wants to merge 2 commits intopurescript:masterfrom
metaleap:master
Conversation
Closed
Author
|
Disregard & discard, I made a better one in #3097 that doesn't modify CoreImp/AST.hs and has a somewhat easier-parseable JSON output format |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
New
purs compileoption--dump-coreimp, exactly like the existing--dump-corefn, to dump theCoreImpAST to acoreimp.jsonoutput file.Requested in #876 and also in #711 in the comments
(The results can be seen in the various
coreimp.jsonfiles throughout https://github.com/metaleap/gopure-demos/tree/master/01_hello_stranger/output )New modules:
src/Language/PureScript/CoreImp/ToJSON.hs--- minimalist, modeled after the existingsrc/Language/PureScript/CoreFn/ToJSON.hs, same code conventions AFAICT. (Has duplicated the trivial tiny helper functionsidentToJSONandmoduleNameToJSONas I didn't want to impress changes on to what the existing original exports.)Existing modules:
--dump-corefnoption handling in:app/Command/Compile.hssrc/Language/PureScript/Make.hssrc/Language/PureScript/Options.hs(Too small & trivial to generalize into helper funcs for now IMHO --- until a 3rd
--dump-xyzrequest comes along in the future at least.)DeriveGenericthe 3ToJSONinstances forAST,UnaryOperator,BinaryOperatorin:src/Language/PureScript/CoreImp/AST.hs