|
|
@@ -104,16 +104,19 @@ fun_header:
|
|
|
|
|
|
param:
|
|
|
(* parameter: use location of parameter name *)
|
|
|
- ctype=basic_type; name=ID
|
|
|
+ | ctype=basic_type; name=ID
|
|
|
{ Param (ctype, name, loc $startpos(name) $endpos(name)) }
|
|
|
|
|
|
+ | ctype=basic_type; LBRACK; dims=separated_list(COMMA, ID); RBRACK; name=ID
|
|
|
+ { Param (ArrayDec (ctype, dims), name, loc $startpos(name) $endpos(name)) }
|
|
|
+
|
|
|
fun_body:
|
|
|
- var_dec* local_fun_dec* statement* loption(return_statement)
|
|
|
+ | var_dec* local_fun_dec* statement* loption(return_statement)
|
|
|
{ $1 @ $2 @ $3 @ $4 }
|
|
|
|
|
|
return_statement:
|
|
|
(* return statement: use location of return value *)
|
|
|
- RETURN; value=expr; SEMICOL
|
|
|
+ | RETURN; value=expr; SEMICOL
|
|
|
{ [Return (value, loc $startpos(value) $endpos(value))] }
|
|
|
|
|
|
(* function: use location of function name *)
|