diff --git a/AST.mli b/AST.mli index 7feeab9c4..cdef34eba 100644 --- a/AST.mli +++ b/AST.mli @@ -462,7 +462,7 @@ and logic_expr = and bool_expr = Or of kwd_or bin_op reg | And of kwd_and bin_op reg -| Not of kwd_not un_op reg +| Not of kwd_not un_op reg | False of c_False | True of c_True diff --git a/Parser.mly b/Parser.mly index 4d42d57e9..75520bd90 100644 --- a/Parser.mly +++ b/Parser.mly @@ -303,7 +303,7 @@ parameters: par(nsepseq(param_decl,SEMI)) { $1 } param_decl: - Var var COLON type_expr { + Var var COLON param_type { let stop = type_expr_to_region $4 in let region = cover $1 stop and value = { @@ -313,7 +313,7 @@ param_decl: param_type = $4} in ParamVar {region; value} } -| Const var COLON type_expr { +| Const var COLON param_type { let stop = type_expr_to_region $4 in let region = cover $1 stop and value = { @@ -330,7 +330,7 @@ entry_param_decl: ParamConst const -> EntryConst const | ParamVar var -> EntryVar var } -| Storage var COLON type_expr { +| Storage var COLON param_type { let stop = type_expr_to_region $4 in let region = cover $1 stop and value = { @@ -341,6 +341,21 @@ entry_param_decl: in EntryStore {region; value} } +param_type: + nsepseq(core_param_type,TIMES) { + let region = nsepseq_to_region type_expr_to_region $1 + in TProd {region; value=$1} + } + +core_param_type: + type_name { + TAlias $1 + } +| type_name type_tuple { + let region = cover $1.region $2.region + in TApp {region; value = $1,$2} + } + block: Begin series(instruction) { let first, (others, terminator, close) = $2 in