Space vs function call

Beat me to it, I was typing a similar response.

But basically, here:

call_args_no_parens_many -> matched_expr ',' call_args_no_parens_kw : ['$1', '$3'].
call_args_no_parens_many -> call_args_no_parens_comma_expr : reverse('$1').
call_args_no_parens_many -> call_args_no_parens_comma_expr ',' call_args_no_parens_kw : reverse(['$3' | '$1']).

It’s implying that if (foo, bar) is being parsed as a function without parenthesis on its arguments, therefore it expects no parenthesis after the space, yet it found one, therefore the error.

It doesn’t parse to anything because it fails to parse in the first place.

The first response was fine :man_shrugging:

Usually when I want to see what something parses to I just call Code.string_to_quoted or quote/2, depending on if I want more metadata or not. If it fails to parse then it’s not valid syntax.

4 Likes