[code-reflection] RFR: OpWriter.ColoringOption proposal [v3]

Adam Sotona asotona at openjdk.org
Tue Sep 9 08:54:15 UTC 2025


On Mon, 8 Sep 2025 17:57:03 GMT, Adam Sotona <asotona at openjdk.org> wrote:

>> I propose `OpWriter` enables simple ANSI coloring based on `jdk.incubator.code.extern.OpWriter.COLOR` system property.
>> 
>> ANSI coloring sample:
>> <img width="989" height="746" alt="ansi-coloring" src="https://github.com/user-attachments/assets/2025bcbe-6c6c-48ab-8ed5-67ff88b47fe6" />
>
> Adam Sotona has updated the pull request incrementally with one additional commit since the last revision:
> 
>   removed ColoringOption
>   ANSI coloring is triggered by jdk.incubator.code.extern.OpWriter.COLOR property

I see the problem. `OpWriter` declares:
 "A code model in textual form may be parsed back into the runtime form by parsing it."

Technically it should be easy for `OpParser` to ignore the coloring. 
The question here is if a 3rd-party parsers should be able to parse it (effectively making the textual form an API)?

-------------

PR Comment: https://git.openjdk.org/babylon/pull/546#issuecomment-3269593177


More information about the babylon-dev mailing list