juvix
juvix copied to clipboard
Faithfully pretty print `Internal` and `Core`
Currently only Concrete
syntax can be printed faithfully to what the user wrote.
-
In many parts of the compiler we need to print
Internal
andCore
(to a lesser extend, at least for now) code. E.g. error messages, repl, type information in the IDE, etc. When printing these fragments of code inInternal
orCore
we have been careful to print them in a way that they resembleConcrete
code, so that it is often very clear what it means and what is the equivalentConcrete
code. However, we need a long term solution to printInternal
exactly as it was parsed. Eventually, we will need to support this inCore
too, especially, when we move typechecking there. This issue will become more and more important as we extend the frontend syntax (#1638, #2126, #1992 etc.). -
I would say that this should be done after #2002 to minimize the amount of redundant work.
In order to implement this, we should probably use the Info
strategy (or something similar) that we are using in Core
.