Parser: functions and coarrays in derived types
I discovered several issues that we should fix:
expr
// ### primary
: id { $$ = $1; }
| struct_member_star id { NAME1($$, $2, $1, @$); }
| id "(" fnarray_arg_list_opt ")" { $$ = FUNCCALLORARRAY($1, $3, @$); }
| id "(" fnarray_arg_list_opt ")" "(" fnarray_arg_list_opt ")" {
$$ = FUNCCALLORARRAY3($1, $3, $6, @$); }
| id "[" coarray_arg_list "]" {
$$ = COARRAY1($1, $3, @$); }
| id "(" fnarray_arg_list_opt ")" "[" coarray_arg_list "]" {
$$ = COARRAY2($1, $3, $6, @$); }
| struct_member_star id "(" fnarray_arg_list_opt ")" {
$$ = FUNCCALLORARRAY2($1, $2, $4, @$); }
If you look at this, you can see that the following are covered:
x
s%x
f(3)
s%f(3)
f(3)(4)
f[3]
f(3)[4]
But the following are not:
s%f(3)(4)
s%f[3]
s%f(3)[4]
The last three cases should be added to the parser and tested.