gpt4 book ai didi

c# - 从 Python pretty-print C#

转载 作者:太空宇宙 更新时间:2023-11-03 19:39:47 26 4
gpt4 key购买 nike

假设我用 Python 或 Ruby 编写了一个编译器,可将语言转换为 C# AST。

如何从 Python 或 Ruby 漂亮地打印此 AST 以获得良好缩进的 C# 代码?

Thanks, Joel

最佳答案

在Python中pprint模块可用。

根据您的数据结构,它可能不会返回您想要的结果。

关于c# - 从 Python pretty-print C#,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/734413/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com