@@ -186,8 +186,8 @@ defmodule IO.ANSI do
186
186
[[[[[[], "Hello, "] | "\e[31m"] | "\e[1m"], "world!"] | "\e[0m"]
187
187
188
188
"""
189
- def format ( chardata , emit \\ enabled? ) when is_boolean ( emit ) do
190
- do_format ( chardata , [ ] , [ ] , emit , :maybe )
189
+ def format ( chardata , emit? \\ enabled? ) when is_boolean ( emit? ) do
190
+ do_format ( chardata , [ ] , [ ] , emit? , :maybe )
191
191
end
192
192
193
193
@ doc ~S"""
@@ -206,12 +206,12 @@ defmodule IO.ANSI do
206
206
[[[[[[] | "\e[1m"], 87], 111], 114], 100]
207
207
208
208
"""
209
- def format_fragment ( chardata , emit \\ enabled? ) when is_boolean ( emit ) do
210
- do_format ( chardata , [ ] , [ ] , emit , false )
209
+ def format_fragment ( chardata , emit? \\ enabled? ) when is_boolean ( emit? ) do
210
+ do_format ( chardata , [ ] , [ ] , emit? , false )
211
211
end
212
212
213
- defp do_format ( [ term | rest ] , rem , acc , emit , append_reset ) do
214
- do_format ( term , [ rest | rem ] , acc , emit , append_reset )
213
+ defp do_format ( [ term | rest ] , rem , acc , emit? , append_reset ) do
214
+ do_format ( term , [ rest | rem ] , acc , emit? , append_reset )
215
215
end
216
216
217
217
defp do_format ( term , rem , acc , true , append_reset ) when is_atom ( term ) do
@@ -222,19 +222,19 @@ defmodule IO.ANSI do
222
222
do_format ( [ ] , rem , acc , false , append_reset )
223
223
end
224
224
225
- defp do_format ( term , rem , acc , emit , append_reset ) when not is_list ( term ) do
226
- do_format ( [ ] , rem , [ acc | [ term ] ] , emit , append_reset )
225
+ defp do_format ( term , rem , acc , emit? , append_reset ) when not is_list ( term ) do
226
+ do_format ( [ ] , rem , [ acc , term ] , emit? , append_reset )
227
227
end
228
228
229
- defp do_format ( [ ] , [ next | rest ] , acc , emit , append_reset ) do
230
- do_format ( next , rest , acc , emit , append_reset )
229
+ defp do_format ( [ ] , [ next | rest ] , acc , emit? , append_reset ) do
230
+ do_format ( next , rest , acc , emit? , append_reset )
231
231
end
232
232
233
233
defp do_format ( [ ] , [ ] , acc , true , true ) do
234
234
[ acc | IO.ANSI . reset ]
235
235
end
236
236
237
- defp do_format ( [ ] , [ ] , acc , _emit , _append_reset ) do
237
+ defp do_format ( [ ] , [ ] , acc , _emit? , _append_reset ) do
238
238
acc
239
239
end
240
240
end
0 commit comments