internal: use custom rendering for --expandArc
#813
Merged
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.
Summary
Report the output for
--expandArc
via manualmsgWrite
calls insteadof using
localReport
and use custom render-to-text logic for thePNode
tree. The rendering logic is kept simple, and while theoutput of
--expandArc
stays largely the same, it doesn't representvalid NimSkull code anymore.
This is a preparation for the introduction of a code-generator IR, as
with it,
astgen
is not going to outputPNode
AST anymore, meaningthat
renderTree
cannot be used there.Details
The
rsemExpandArc
report is removed and everything associated with it.While it could be kept, the general direction it to move aways from
reports for compiler tracing, and so
msgWrite
is instead used. Thisalso helps with getting around cyclic imports once the new IR is
introduced.
The rendering logic is a simplified version of
renderTree
, withmore complex text-layouting and conditional logic removed. The supported
AST shapes are similar to that of the planned initial version of the
code-generator IR, and the routines are added to the new
cgirutils
module.
In order for changes to the
expandArc
-using tests to stay small, therendered output is kept compatible with that of
renderTree(n, {renderIr, renderNoComment})
, where reasonable.