您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

430 行
19 KiB

  1. %%%
  2. %%% General colour conventions mostly follow the same schema
  3. %%% that git uses:
  4. %%%
  5. %%% * cyan: files/lines or locations in general
  6. %%% * bold: important text i.e. the human parts of warnings
  7. %%% this allows quickly 'scanning' over a warning fading
  8. %%% out the cody bits
  9. %%% * red: things that went bad, i.e. the wrong argument in a
  10. %%% call. It allows to quickly catching where in the code
  11. %%% ane error is.
  12. %%% * green: the 'good' stuff, i.e. what was expected as an argument
  13. %%% the 'red vs green' resambles the diff view 'remove vs add'
  14. %%% * blue: argument positions.
  15. -module(rebar_dialyzer_format).
  16. -include("rebar.hrl").
  17. -export([format_warnings/2]).
  18. %% Formats a list of warnings in a nice per file way. Note that we reverse
  19. %% the list at the end to 'undo' the reversal by foldl
  20. format_warnings(Opts, Warnings) ->
  21. Fold = fun(Warning, Acc) -> format_warning_(Opts, Warning, Acc) end,
  22. {_, Res} = lists:foldl(Fold, {undefined, []}, Warnings),
  23. lists:reverse(Res).
  24. %% If the last seen file is and the file of this warning are the same
  25. %% we skip the file header
  26. format_warning_(_Opts, Warning = {_Tag, {File, Line}, Msg}, {File, Acc}) ->
  27. try
  28. String = message_to_string(Msg),
  29. {File, [lists:flatten(fmt("~!c~4w~!!: ~ts", [Line, String])) | Acc]}
  30. catch
  31. Error:Reason ->
  32. ?DEBUG("Failed to pretty format warning: ~p:~p",
  33. [Error, Reason]),
  34. {File, [dialyzer:format_warning(Warning, fullpath) | Acc]}
  35. end;
  36. %% With a new file detencted we also write a file header.
  37. format_warning_(Opts, Warning = {_Tag, {SrcFile, Line}, Msg}, {_LastFile, Acc}) ->
  38. try
  39. File = rebar_dir:format_source_file_name(SrcFile, Opts),
  40. Base = filename:basename(File),
  41. Dir = filename:dirname(File),
  42. Root = filename:rootname(Base),
  43. Ext = filename:extension(Base),
  44. Path = re:replace(Dir, "^.*/_build/", "_build/", [{return, list}, unicode]),
  45. Base1 = fmt("~!_c~ts~!!~!__~ts", [Root, Ext]),
  46. F = fmt("~!__~ts", [filename:join(Path, Base1)]),
  47. String = message_to_string(Msg),
  48. {SrcFile, [lists:flatten(fmt("~n~ts~n~!c~4w~!!: ~ts", [F, Line, String])) | Acc]}
  49. catch
  50. ?WITH_STACKTRACE(Error, Reason, Stacktrace)
  51. ?DEBUG("Failed to pretty format warning: ~p:~p~n~p",
  52. [Error, Reason, Stacktrace]),
  53. {SrcFile, [dialyzer:format_warning(Warning, fullpath) | Acc]}
  54. end.
  55. fmt(Fmt) ->
  56. cf:format(Fmt, []).
  57. fmt(Fmt, Args) ->
  58. cf:format(Fmt, Args).
  59. %%-----------------------------------------------------------------------------
  60. %% Message classification and pretty-printing below. Messages appear in
  61. %% categories and in more or less alphabetical ordering within each category.
  62. %%-----------------------------------------------------------------------------
  63. %%----- Warnings for general discrepancies ----------------
  64. message_to_string({apply, [Args, ArgNs, FailReason,
  65. SigArgs, SigRet, Contract]}) ->
  66. fmt("~!^Fun application with arguments ~!!~ts ",
  67. [bad_arg(ArgNs, Args)]) ++
  68. call_or_apply_to_string(ArgNs, FailReason, SigArgs, SigRet, Contract);
  69. message_to_string({app_call, [M, F, Args, Culprit, ExpectedType, FoundType]}) ->
  70. fmt("~!^The call~!! ~ts:~ts~ts ~!^requires that"
  71. "~!! ~ts ~!^is of type ~!g~ts~!^ not ~!r~ts",
  72. [M, F, Args, Culprit, ExpectedType, FoundType]);
  73. message_to_string({bin_construction, [Culprit, Size, Seg, Type]}) ->
  74. fmt("~!^Binary construction will fail since the ~!b~ts~!^ field~!!"
  75. " ~ts~!^ in segment~!! ~ts~!^ has type~!! ~ts",
  76. [Culprit, Size, Seg, Type]);
  77. message_to_string({call, [M, F, Args, ArgNs, FailReason,
  78. SigArgs, SigRet, Contract]}) ->
  79. fmt("~!^The call~!! ~w:~w~ts ", [M, F, bad_arg(ArgNs, Args)]) ++
  80. call_or_apply_to_string(ArgNs, FailReason, SigArgs, SigRet, Contract);
  81. message_to_string({call_to_missing, [M, F, A]}) ->
  82. fmt("~!^Call to missing or unexported function ~!!~w:~w/~w",
  83. [M, F, A]);
  84. message_to_string({exact_eq, [Type1, Op, Type2]}) ->
  85. fmt("~!^The test ~!!~ts ~ts ~ts~!^ can never evaluate to 'true'",
  86. [Type1, Op, Type2]);
  87. message_to_string({fun_app_args, [Args, Type]}) ->
  88. fmt("~!^Fun application with arguments ~!!~ts~!^ will fail"
  89. " since the function has type ~!!~ts", [Args, Type]);
  90. message_to_string({fun_app_no_fun, [Op, Type, Arity]}) ->
  91. fmt("~!^Fun application will fail since ~!!~ts ~!^::~!! ~ts"
  92. " is not a function of arity ~!!~w", [Op, Type, Arity]);
  93. message_to_string({guard_fail, []}) ->
  94. "~!^Clause guard cannot succeed.~!!";
  95. message_to_string({guard_fail, [Arg1, Infix, Arg2]}) ->
  96. fmt("~!^Guard test ~!!~ts ~ts ~ts~!^ can never succeed",
  97. [Arg1, Infix, Arg2]);
  98. message_to_string({neg_guard_fail, [Arg1, Infix, Arg2]}) ->
  99. fmt("~!^Guard test not(~!!~ts ~ts ~ts~!^) can never succeed",
  100. [Arg1, Infix, Arg2]);
  101. message_to_string({guard_fail, [Guard, Args]}) ->
  102. fmt("~!^Guard test ~!!~w~ts~!^ can never succeed",
  103. [Guard, Args]);
  104. message_to_string({neg_guard_fail, [Guard, Args]}) ->
  105. fmt("~!^Guard test not(~!!~w~ts~!^) can never succeed",
  106. [Guard, Args]);
  107. message_to_string({guard_fail_pat, [Pat, Type]}) ->
  108. fmt("~!^Clause guard cannot succeed. The ~!!~ts~!^ was matched"
  109. " against the type ~!!~ts", [Pat, Type]);
  110. message_to_string({improper_list_constr, [TlType]}) ->
  111. fmt("~!^Cons will produce an improper list"
  112. " since its ~!b2~!!nd~!^ argument is~!! ~ts", [TlType]);
  113. message_to_string({no_return, [Type|Name]}) ->
  114. NameString =
  115. case Name of
  116. [] -> fmt("~!^The created fun ");
  117. [F, A] -> fmt("~!^Function ~!r~w/~w ", [F, A])
  118. end,
  119. case Type of
  120. no_match -> fmt("~ts~!^has no clauses that will ever match",[NameString]);
  121. only_explicit -> fmt("~ts~!^only terminates with explicit exception", [NameString]);
  122. only_normal -> fmt("~ts~!^has no local return", [NameString]);
  123. both -> fmt("~ts~!^has no local return", [NameString])
  124. end;
  125. message_to_string({record_constr, [RecConstr, FieldDiffs]}) ->
  126. fmt("~!^Record construction ~!!~ts~!^ violates the"
  127. " declared type of field ~!!~ts", [RecConstr, FieldDiffs]);
  128. message_to_string({record_constr, [Name, Field, Type]}) ->
  129. fmt("~!^Record construction violates the declared type for ~!!#~w{}~!^"
  130. " since ~!!~ts~!^ cannot be of type ~!!~ts",
  131. [Name, Field, Type]);
  132. message_to_string({record_matching, [String, Name]}) ->
  133. fmt("~!^The ~!!~ts~!^ violates the"
  134. " declared type for ~!!#~w{}", [String, Name]);
  135. message_to_string({record_match, [Pat, Type]}) ->
  136. fmt("~!^Matching of ~!!~ts~!^ tagged with a record name violates the"
  137. " declared type of ~!!~ts", [Pat, Type]);
  138. message_to_string({pattern_match, [Pat, Type]}) ->
  139. fmt("~!^The ~ts~!^ can never match the type ~!g~ts",
  140. [bad_pat(Pat), Type]);
  141. message_to_string({pattern_match_cov, [Pat, Type]}) ->
  142. fmt("~!^The ~ts~!^ can never match since previous"
  143. " clauses completely covered the type ~!g~ts",
  144. [bad_pat(Pat), Type]);
  145. message_to_string({unmatched_return, [Type]}) ->
  146. fmt("~!^Expression produces a value of type ~!!~ts~!^,"
  147. " but this value is unmatched", [Type]);
  148. message_to_string({unused_fun, [F, A]}) ->
  149. fmt("~!^Function ~!r~w/~w~!!~!^ will never be called", [F, A]);
  150. %%----- Warnings for specs and contracts -------------------
  151. message_to_string({contract_diff, [M, F, _A, Contract, Sig]}) ->
  152. fmt("~!^Type specification ~!!~w:~w~ts~!^"
  153. " is not equal to the success typing: ~!!~w:~w~ts",
  154. [M, F, Contract, M, F, Sig]);
  155. message_to_string({contract_subtype, [M, F, _A, Contract, Sig]}) ->
  156. fmt("~!^Type specification ~!!~w:~w~ts~!^"
  157. " is a subtype of the success typing: ~!!~w:~w~ts",
  158. [M, F, Contract, M, F, Sig]);
  159. message_to_string({contract_supertype, [M, F, _A, Contract, Sig]}) ->
  160. fmt("~!^Type specification ~!!~w:~w~ts~!^"
  161. " is a supertype of the success typing: ~!!~w:~w~ts",
  162. [M, F, Contract, M, F, Sig]);
  163. message_to_string({contract_range, [Contract, M, F, ArgStrings, Line, CRet]}) ->
  164. fmt("~!^The contract ~!!~w:~w~ts~!^ cannot be right because the"
  165. " inferred return for ~!!~w~ts~!^ on line ~!!~w~!^ is ~!!~ts",
  166. [M, F, Contract, F, ArgStrings, Line, CRet]);
  167. message_to_string({invalid_contract, [M, F, A, Sig]}) ->
  168. fmt("~!^Invalid type specification for function~!! ~w:~w/~w."
  169. "~!^ The success typing is~!! ~ts", [M, F, A, Sig]);
  170. message_to_string({extra_range, [M, F, A, ExtraRanges, SigRange]}) ->
  171. fmt("~!^The specification for ~!!~w:~w/~w~!^ states that the function"
  172. " might also return ~!!~ts~!^ but the inferred return is ~!!~ts",
  173. [M, F, A, ExtraRanges, SigRange]);
  174. message_to_string({overlapping_contract, [M, F, A]}) ->
  175. fmt("~!^Overloaded contract for ~!!~w:~w/~w~!^ has overlapping"
  176. " domains; such contracts are currently unsupported and are simply "
  177. "ignored", [M, F, A]);
  178. message_to_string({spec_missing_fun, [M, F, A]}) ->
  179. fmt("~!^Contract for function that does not exist: ~!!~w:~w/~w",
  180. [M, F, A]);
  181. %%----- Warnings for opaque type violations -------------------
  182. message_to_string({call_with_opaque, [M, F, Args, ArgNs, ExpArgs]}) ->
  183. fmt("~!^The call ~!!~w:~w~ts~!^ contains ~!!~ts~!^ when ~!!~ts",
  184. [M, F, bad_arg(ArgNs, Args), form_positions(ArgNs), form_expected(ExpArgs)]);
  185. message_to_string({call_without_opaque, [M, F, Args, [{N,_,_}|_] = ExpectedTriples]}) ->
  186. fmt("~!^The call ~!!~w:~w~ts ~!^does not have~!! ~ts",
  187. [M, F, bad_arg(N, Args), form_expected_without_opaque(ExpectedTriples)]);
  188. message_to_string({opaque_eq, [Type, _Op, OpaqueType]}) ->
  189. fmt("~!^Attempt to test for equality between a term of type ~!!~ts~!^"
  190. " and a term of opaque type ~!!~ts", [Type, OpaqueType]);
  191. message_to_string({opaque_guard, [Arg1, Infix, Arg2, ArgNs]}) ->
  192. fmt("~!^Guard test ~!!~ts ~ts ~ts~!^ contains ~!!~ts",
  193. [Arg1, Infix, Arg2, form_positions(ArgNs)]);
  194. message_to_string({opaque_guard, [Guard, Args]}) ->
  195. fmt("~!^Guard test ~!!~w~ts~!^ breaks the opaqueness of its"
  196. " argument", [Guard, Args]);
  197. message_to_string({opaque_match, [Pat, OpaqueType, OpaqueTerm]}) ->
  198. Term = if OpaqueType =:= OpaqueTerm -> "the term";
  199. true -> OpaqueTerm
  200. end,
  201. fmt("~!^The attempt to match a term of type ~!!~ts~!^ against the"
  202. "~!! ~ts~!^ breaks the opaqueness of ~!!~ts",
  203. [OpaqueType, Pat, Term]);
  204. message_to_string({opaque_neq, [Type, _Op, OpaqueType]}) ->
  205. fmt("~!^Attempt to test for inequality between a term of type ~!!~ts"
  206. "~!^ and a term of opaque type ~!!~ts", [Type, OpaqueType]);
  207. message_to_string({opaque_type_test, [Fun, Args, Arg, ArgType]}) ->
  208. fmt("~!^The type test ~!!~ts~ts~!^ breaks the opaqueness of the term "
  209. "~!!~ts~ts", [Fun, Args, Arg, ArgType]);
  210. message_to_string({opaque_size, [SizeType, Size]}) ->
  211. fmt("~!^The size ~!!~ts~!^ breaks the opaqueness of ~!!~ts",
  212. [SizeType, Size]);
  213. message_to_string({opaque_call, [M, F, Args, Culprit, OpaqueType]}) ->
  214. fmt("~!^The call ~!!~ts:~ts~ts~!^ breaks the opaqueness of the term~!!"
  215. " ~ts :: ~ts", [M, F, Args, Culprit, OpaqueType]);
  216. %%----- Warnings for concurrency errors --------------------
  217. message_to_string({race_condition, [M, F, Args, Reason]}) ->
  218. fmt("~!^The call ~!!~w:~w~ts ~ts", [M, F, Args, Reason]);
  219. %%----- Warnings for behaviour errors --------------------
  220. message_to_string({callback_type_mismatch, [B, F, A, ST, CT]}) ->
  221. fmt("~!^The inferred return type of~!! ~w/~w (~ts) ~!^"
  222. "has nothing in common with~!! ~ts, ~!^which is the expected"
  223. " return type for the callback of~!! ~w ~!^behaviour",
  224. [F, A, ST, CT, B]);
  225. message_to_string({callback_arg_type_mismatch, [B, F, A, N, ST, CT]}) ->
  226. fmt("~!^The inferred type for the~!! ~ts ~!^argument of~!!"
  227. " ~w/~w (~ts) ~!^is not a supertype of~!! ~ts~!^, which is"
  228. "expected type for this argument in the callback of the~!! ~w "
  229. "~!^behaviour",
  230. [ordinal(N), F, A, ST, CT, B]);
  231. message_to_string({callback_spec_type_mismatch, [B, F, A, ST, CT]}) ->
  232. fmt("~!^The return type ~!!~ts~!^ in the specification of ~!!"
  233. "~w/~w~!^ is not a subtype of ~!!~ts~!^, which is the expected"
  234. " return type for the callback of ~!!~w~!^ behaviour",
  235. [ST, F, A, CT, B]);
  236. message_to_string({callback_spec_arg_type_mismatch, [B, F, A, N, ST, CT]}) ->
  237. fmt("~!^The specified type for the ~!!~ts~!^ argument of ~!!"
  238. "~w/~w (~ts)~!^ is not a supertype of ~!!~ts~!^, which is"
  239. " expected type for this argument in the callback of the ~!!~w"
  240. "~!^ behaviour", [ordinal(N), F, A, ST, CT, B]);
  241. message_to_string({callback_missing, [B, F, A]}) ->
  242. fmt("~!^Undefined callback function ~!!~w/~w~!^ (behaviour ~!!"
  243. "'~w'~!^)",[F, A, B]);
  244. message_to_string({callback_info_missing, [B]}) ->
  245. fmt("~!^Callback info about the ~!r~w~!!~!^"
  246. " behaviour is not available", [B]);
  247. %%----- Warnings for unknown functions, types, and behaviours -------------
  248. message_to_string({unknown_type, {M, F, A}}) ->
  249. fmt("~!^Unknown type ~!r~w:~w/~w", [M, F, A]);
  250. message_to_string({unknown_function, {M, F, A}}) ->
  251. fmt("~!^Unknown function ~!r~w:~w/~w", [M, F, A]);
  252. message_to_string({unknown_behaviour, B}) ->
  253. fmt("~!^Unknown behaviour ~!r~w", [B]).
  254. %%-----------------------------------------------------------------------------
  255. %% Auxiliary functions below
  256. %%-----------------------------------------------------------------------------
  257. call_or_apply_to_string(ArgNs, FailReason, SigArgs, SigRet,
  258. {IsOverloaded, Contract}) ->
  259. PositionString = form_position_string(ArgNs),
  260. case FailReason of
  261. only_sig ->
  262. case ArgNs =:= [] of
  263. true ->
  264. %% We do not know which argument(s) caused the failure
  265. fmt("~!^will never return since the success typing arguments"
  266. " are ~!!~ts", [SigArgs]);
  267. false ->
  268. fmt("~!^will never return since it differs in the~!!"
  269. " ~ts ~!^argument from the success typing"
  270. " arguments:~!! ~ts",
  271. [PositionString, good_arg(ArgNs, SigArgs)])
  272. end;
  273. only_contract ->
  274. case (ArgNs =:= []) orelse IsOverloaded of
  275. true ->
  276. %% We do not know which arguments caused the failure
  277. fmt("~!^breaks the contract~!! ~ts", [good_arg(ArgNs, Contract)]);
  278. false ->
  279. fmt("~!^breaks the contract~!! ~ts ~!^in the~!!"
  280. " ~ts ~!^argument",
  281. [good_arg(ArgNs, Contract), PositionString])
  282. end;
  283. both ->
  284. fmt("~!^will never return since the success typing is "
  285. "~!!~ts ~!^->~!! ~ts ~!^and the contract is ~!!~ts",
  286. [good_arg(ArgNs, SigArgs), SigRet,
  287. good_arg(ArgNs, Contract)])
  288. end.
  289. form_positions(ArgNs) ->
  290. ArgS = form_position_string(ArgNs),
  291. case ArgNs of
  292. [_] -> fmt("~!^an opaque term as ~!!~ts~!^ argument", [ArgS]);
  293. [_,_|_] -> fmt("~!^opaque terms as ~!!~ts~!^ arguments", [ArgS])
  294. end.
  295. %% We know which positions N are to blame;
  296. %% the list of triples will never be empty.
  297. form_expected_without_opaque([{N, T, TStr}]) ->
  298. FStr = case erl_types:t_is_opaque(T) of
  299. true ->
  300. "~!^an opaque term of type~!g ~ts ~!^as ";
  301. false ->
  302. "~!^a term of type ~!g~ts ~!^(with opaque subterms) as "
  303. end ++ form_position_string([N]) ++ "~!^ argument",
  304. fmt(FStr, [TStr]);
  305. form_expected_without_opaque(ExpectedTriples) -> %% TODO: can do much better here
  306. {ArgNs, _Ts, _TStrs} = lists:unzip3(ExpectedTriples),
  307. "opaque terms as " ++ form_position_string(ArgNs) ++ " arguments".
  308. form_expected(ExpectedArgs) ->
  309. case ExpectedArgs of
  310. [T] ->
  311. TS = erl_types:t_to_string(T),
  312. case erl_types:t_is_opaque(T) of
  313. true -> fmt("~!^an opaque term of type ~!!~ts~!^ is"
  314. " expected", [TS]);
  315. false -> fmt("~!^a structured term of type ~!!~ts~!^ is"
  316. " expected", [TS])
  317. end;
  318. [_,_|_] -> fmt("~!^terms of different types are expected in these"
  319. " positions", [])
  320. end.
  321. form_position_string(ArgNs) ->
  322. case ArgNs of
  323. [] -> "";
  324. [N1] -> ordinal(N1);
  325. [_,_|_] ->
  326. [Last|Prevs] = lists:reverse(ArgNs),
  327. ", " ++ Head = lists:flatten([fmt(", ~ts",[ordinal(N)]) ||
  328. N <- lists:reverse(Prevs)]),
  329. Head ++ " and " ++ ordinal(Last)
  330. end.
  331. ordinal(1) -> fmt("~!B1~!!st");
  332. ordinal(2) -> fmt("~!B2~!!nd");
  333. ordinal(3) -> fmt("~!B3~!!rd");
  334. ordinal(N) when is_integer(N) -> fmt("~!B~w~!!th", [N]).
  335. %% Format a pattern ad highlight errorous part in red.
  336. bad_pat("pattern " ++ P) ->
  337. fmt("pattern ~!r~ts",[P]);
  338. bad_pat("variable " ++ P) ->
  339. fmt("variable ~!r~ts",[P]);
  340. bad_pat(P) ->
  341. fmt("~!r~ts",[P]).
  342. bad_arg(N, Args) ->
  343. colour_arg(N, r, Args).
  344. good_arg(N, Args) ->
  345. colour_arg(N, g, Args).
  346. %% colour one or more arg of an argument list, this unparses the args
  347. %% highlights one or more of them and puts them back together.
  348. colour_arg(N, C, Args) when is_integer(N) ->
  349. colour_arg([N], C, Args);
  350. colour_arg(Ns, C, Args) ->
  351. {Args1, Rest} =separate_args(Args),
  352. Args2 = highlight(Ns, 1, C, Args1),
  353. join_args(Args2) ++ Rest.
  354. highlight([], _N, _C, Rest) ->
  355. Rest;
  356. highlight([N | Nr], N, g, [Arg | Rest]) ->
  357. [fmt("~!g~ts", [Arg]) | highlight(Nr, N+1, g, Rest)];
  358. highlight([N | Nr], N, r, [Arg | Rest]) ->
  359. [fmt("~!r~ts", [Arg]) | highlight(Nr, N+1, r, Rest)];
  360. highlight(Ns, N, C, [Arg | Rest]) ->
  361. [Arg | highlight(Ns, N + 1, C, Rest)].
  362. %% Arugments to functions and constraints are passed as
  363. %% strings not as data, this function pulls them apart
  364. %% to allow interacting with them separately and not
  365. %% as one bug chunk of data.
  366. separate_args([$( | S]) ->
  367. separate_args([], S, "", []).
  368. %% We strip this space since dialyzer is inconsistant in adding or not adding
  369. %% it ....
  370. separate_args([], [$,, $\s | R], Arg, Args) ->
  371. separate_args([], R, [], [lists:reverse(Arg) | Args]);
  372. separate_args([], [$, | R], Arg, Args) ->
  373. separate_args([], R, [], [lists:reverse(Arg) | Args]);
  374. separate_args([], [$) | Rest], Arg, Args) ->
  375. {lists:reverse([lists:reverse(Arg) | Args]), Rest};
  376. separate_args([C | D], [C | R], Arg, Args) ->
  377. separate_args(D, R, [C | Arg], Args);
  378. %% Brackets
  379. separate_args(D, [${ | R], Arg, Args) ->
  380. separate_args([$}|D], R, [${ | Arg], Args);
  381. separate_args(D, [$( | R], Arg, Args) ->
  382. separate_args([$)|D], R, [$( | Arg], Args);
  383. separate_args(D, [$[ | R], Arg, Args) ->
  384. separate_args([$]|D], R, [$[ | Arg], Args);
  385. separate_args(D, [$< | R], Arg, Args) ->
  386. separate_args([$>|D], R, [$< | Arg], Args);
  387. %% 'strings'
  388. separate_args(D, [$' | R], Arg, Args) ->
  389. separate_args([$'|D], R, [$' | Arg], Args);
  390. separate_args(D, [$" | R], Arg, Args) ->
  391. separate_args([$"|D], R, [$" | Arg], Args);
  392. separate_args(D, [C | R], Arg, Args) ->
  393. separate_args(D, R, [C | Arg], Args).
  394. join_args(Args) ->
  395. [$(, rebar_string:join(Args, ", "), $)].