OLD | NEW |
(Empty) | |
| 1 40 columns | |
| 2 >>> require at least one newline between statements in a case |
| 3 switch (foo) {case 0:a();b();c();} |
| 4 <<< |
| 5 switch (foo) { |
| 6 case 0: |
| 7 a(); |
| 8 b(); |
| 9 c(); |
| 10 } |
| 11 >>> allow an extra newline between statements in a case |
| 12 switch (foo) {case 0: |
| 13 a(); |
| 14 |
| 15 b(); |
| 16 c(); |
| 17 } |
| 18 <<< |
| 19 switch (foo) { |
| 20 case 0: |
| 21 a(); |
| 22 |
| 23 b(); |
| 24 c(); |
| 25 } |
| 26 >>> collapse any other newlines in a case |
| 27 switch (foo) {case 0: |
| 28 |
| 29 |
| 30 a(); |
| 31 |
| 32 |
| 33 |
| 34 b(); |
| 35 |
| 36 |
| 37 |
| 38 c(); |
| 39 |
| 40 |
| 41 } |
| 42 <<< |
| 43 switch (foo) { |
| 44 case 0: |
| 45 a(); |
| 46 |
| 47 b(); |
| 48 |
| 49 c(); |
| 50 } |
| 51 >>> require at least one newline between statements in a default |
| 52 switch (foo) {default:a();b();c();} |
| 53 <<< |
| 54 switch (foo) { |
| 55 default: |
| 56 a(); |
| 57 b(); |
| 58 c(); |
| 59 } |
| 60 >>> allow an extra newline between statements in a default |
| 61 switch (foo) {default: |
| 62 a(); |
| 63 |
| 64 b(); |
| 65 c(); |
| 66 } |
| 67 <<< |
| 68 switch (foo) { |
| 69 default: |
| 70 a(); |
| 71 |
| 72 b(); |
| 73 c(); |
| 74 } |
| 75 >>> collapse any other newlines in a default |
| 76 switch (foo) {default: |
| 77 |
| 78 |
| 79 a(); |
| 80 |
| 81 |
| 82 |
| 83 b(); |
| 84 |
| 85 |
| 86 |
| 87 c(); |
| 88 |
| 89 |
| 90 } |
| 91 <<< |
| 92 switch (foo) { |
| 93 default: |
| 94 a(); |
| 95 |
| 96 b(); |
| 97 |
| 98 c(); |
| 99 } |
| 100 >>> require at least one newline between cases |
| 101 switch (foo) {case 0:case 1:case 2:body();} |
| 102 <<< |
| 103 switch (foo) { |
| 104 case 0: |
| 105 case 1: |
| 106 case 2: |
| 107 body(); |
| 108 } |
| 109 >>> allow an extra newline between cases |
| 110 switch (foo) {case 0: |
| 111 |
| 112 case 1: |
| 113 case 2:body(); |
| 114 } |
| 115 <<< |
| 116 switch (foo) { |
| 117 case 0: |
| 118 |
| 119 case 1: |
| 120 case 2: |
| 121 body(); |
| 122 } |
| 123 >>> collapse any other newlines in a case |
| 124 switch (foo) { |
| 125 |
| 126 |
| 127 case 0: |
| 128 |
| 129 |
| 130 case 1: |
| 131 |
| 132 |
| 133 case 2: |
| 134 |
| 135 |
| 136 body(); |
| 137 |
| 138 |
| 139 |
| 140 } |
| 141 <<< |
| 142 switch (foo) { |
| 143 case 0: |
| 144 |
| 145 case 1: |
| 146 |
| 147 case 2: |
| 148 body(); |
| 149 } |
| 150 >>> indentation |
| 151 switch (fruit) { |
| 152 case "apple": |
| 153 print("delish"); |
| 154 break; |
| 155 case "fig": |
| 156 print("bleh"); |
| 157 break; |
| 158 } |
| 159 <<< |
| 160 switch (fruit) { |
| 161 case "apple": |
| 162 print("delish"); |
| 163 break; |
| 164 case "fig": |
| 165 print("bleh"); |
| 166 break; |
| 167 } |
OLD | NEW |