仅在漂亮打印时才坚持使用2种布局

时间:2015-02-17 18:18:42

标签: haskell pretty-print

我正在打印一个C ++方法声明,如果符合该行,我希望参数列表以紧凑的形式呈现:

void method(MyLongClassName& instance, const MyClass& c);

如果不是

,则按列格式化
void method(      MyLongClassName& instance,
            const MyClass&         c,
                  int              counter);

我想要考虑的所有其他布局。 如果没有黑客攻击,似乎既不简单wl-pprint也不pretty

有什么想法吗?

1 个答案:

答案 0 :(得分:0)

如何选择适合单行的布局,如果没有,则使用替代品的更一般问题的解决方案可在此处找到:Optional spaces and multiple alternatives in wl-pprint-extras

相关问题