Restricted types of parameters to cartesian types.
This commit is contained in:
parent
3b318d0f06
commit
fa8adb9bde
2
AST.mli
2
AST.mli
@ -462,7 +462,7 @@ and logic_expr =
|
|||||||
and bool_expr =
|
and bool_expr =
|
||||||
Or of kwd_or bin_op reg
|
Or of kwd_or bin_op reg
|
||||||
| And of kwd_and 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
|
| False of c_False
|
||||||
| True of c_True
|
| True of c_True
|
||||||
|
|
||||||
|
21
Parser.mly
21
Parser.mly
@ -303,7 +303,7 @@ parameters:
|
|||||||
par(nsepseq(param_decl,SEMI)) { $1 }
|
par(nsepseq(param_decl,SEMI)) { $1 }
|
||||||
|
|
||||||
param_decl:
|
param_decl:
|
||||||
Var var COLON type_expr {
|
Var var COLON param_type {
|
||||||
let stop = type_expr_to_region $4 in
|
let stop = type_expr_to_region $4 in
|
||||||
let region = cover $1 stop
|
let region = cover $1 stop
|
||||||
and value = {
|
and value = {
|
||||||
@ -313,7 +313,7 @@ param_decl:
|
|||||||
param_type = $4}
|
param_type = $4}
|
||||||
in ParamVar {region; value}
|
in ParamVar {region; value}
|
||||||
}
|
}
|
||||||
| Const var COLON type_expr {
|
| Const var COLON param_type {
|
||||||
let stop = type_expr_to_region $4 in
|
let stop = type_expr_to_region $4 in
|
||||||
let region = cover $1 stop
|
let region = cover $1 stop
|
||||||
and value = {
|
and value = {
|
||||||
@ -330,7 +330,7 @@ entry_param_decl:
|
|||||||
ParamConst const -> EntryConst const
|
ParamConst const -> EntryConst const
|
||||||
| ParamVar var -> EntryVar var
|
| ParamVar var -> EntryVar var
|
||||||
}
|
}
|
||||||
| Storage var COLON type_expr {
|
| Storage var COLON param_type {
|
||||||
let stop = type_expr_to_region $4 in
|
let stop = type_expr_to_region $4 in
|
||||||
let region = cover $1 stop
|
let region = cover $1 stop
|
||||||
and value = {
|
and value = {
|
||||||
@ -341,6 +341,21 @@ entry_param_decl:
|
|||||||
in EntryStore {region; value}
|
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:
|
block:
|
||||||
Begin series(instruction) {
|
Begin series(instruction) {
|
||||||
let first, (others, terminator, close) = $2 in
|
let first, (others, terminator, close) = $2 in
|
||||||
|
Loading…
Reference in New Issue
Block a user