Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/c/68.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/62.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何";“牢不可破”;带“的C代码;“艺术风格”;_C_Formatting_Astyle - Fatal编程技术网

如何";“牢不可破”;带“的C代码;“艺术风格”;

如何";“牢不可破”;带“的C代码;“艺术风格”;,c,formatting,astyle,C,Formatting,Astyle,使用代码格式化程序,如何实现与逻辑/-xL后的中断相反的效果,以便如果我有 if (thisVariable1 == thatVariable1 || thisVariable2 == thatVariable2 || thisVariable3 == thatVariable3) ... …我得到 if (thisVariable1 == thatVariable1 || thisVariable2 == thatVariable2 || thisVa

使用代码格式化程序,如何实现与逻辑/-xL后的中断相反的效果,以便如果我有

if (thisVariable1 == thatVariable1
        || thisVariable2 == thatVariable2
        || thisVariable3 == thatVariable3)
    ...
…我得到

if (thisVariable1 == thatVariable1 || thisVariable2 == thatVariable2 || thisVariable3 == thatVariable3)
    ...

艺术风格
似乎无法实现这一点

这很合理,因为它实际上混淆了代码:

  • 垂直对齐通过强调相同的模式和不同的模式来提高易读性(单个
    !=
    在一行中更难识别)
  • 它还简化了差异跟踪
我会写:

if  (  thisVariable1   == thatVariable1
    || thisVariable2   == thatVariable2
    || longerVariable3 == thatVariable3 )
    ...

@CloseVoter:如果一个代码美化器不属于“主要用于编程的工具”的范畴,那么我不知道可能会是什么。通过阅读文档:可能是
--unpad paren/-U
?@Jongware刚刚尝试了它,但它不起作用(尽管这是个好主意).我在文档中浏览了包含
merge
join
的命令,似乎这个美化器根本不合并现有行。对吗?@Jongware我想多行处理超出了这个能力范围