@@ -552,6 +552,7 @@ kw_base -> kw_eol container_expr : [{'$1', '$2'}].
552552kw_base -> kw_base ',' kw_eol container_expr : [{'$3' , '$4' } | '$1' ].
553553
554554kw_call -> kw_base : reverse ('$1' ).
555+ kw_call -> kw_base ',' : warn_trailing_comma ('$2' ), reverse ('$1' ).
555556kw_call -> kw_base ',' matched_expr : maybe_bad_keyword_call_follow_up ('$2' , '$1' , '$3' ).
556557
557558kw_data -> kw_base : reverse ('$1' ).
@@ -1166,6 +1167,12 @@ error_invalid_kw_identifier({_, Location, do}) ->
11661167error_invalid_kw_identifier ({_ , Location , KW }) ->
11671168 return_error (Location , " syntax error before: " , " '" ++ atom_to_list (KW ) ++ " :'" ).
11681169
1170+ % % TODO: Make this an error on v2.0
1171+ warn_trailing_comma ({',' , {Line , Column , _ }}) ->
1172+ elixir_errors :erl_warn ({Line , Column }, ? file (),
1173+ " trailing commas are not allowed inside function/macro call arguments"
1174+ ).
1175+
11691176% % TODO: Make this an error on v2.0
11701177warn_empty_paren ({_ , {Line , Column , _ }}) ->
11711178 elixir_errors :erl_warn ({Line , Column }, ? file (),
0 commit comments