Merge branch 'anri' of gaufre.informatique.univ-paris-diderot.fr:Anri/compilation-m1-2023 into anri
This commit is contained in:
commit
6019b902e1
1 changed files with 5 additions and 6 deletions
|
@ -104,7 +104,6 @@ tdefinition:
|
||||||
}
|
}
|
||||||
|
|
||||||
list_constructor_and_their_ty:
|
list_constructor_and_their_ty:
|
||||||
// TODO: C'est pas sensé être en option list_ty ici?
|
|
||||||
| c=located(constructor) t=optionlist(list_ty) {
|
| c=located(constructor) t=optionlist(list_ty) {
|
||||||
(c, t)
|
(c, t)
|
||||||
}
|
}
|
||||||
|
@ -170,10 +169,10 @@ simple_pattern:
|
||||||
/* N-uplets ou parenthésage */
|
/* N-uplets ou parenthésage */
|
||||||
| LPAREN RPAREN {
|
| LPAREN RPAREN {
|
||||||
PTuple([])
|
PTuple([])
|
||||||
}
|
}
|
||||||
| l=pattern_list {
|
| l=pattern_list {
|
||||||
match l with | [alone] -> Position.value alone | _ -> PTuple(l)
|
match l with | [alone] -> Position.value alone | _ -> PTuple(l)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Annotation de type */
|
/* Annotation de type */
|
||||||
| p=located(simple_pattern) COLON ty=located(ty) {
|
| p=located(simple_pattern) COLON ty=located(ty) {
|
||||||
|
@ -382,7 +381,7 @@ expression:
|
||||||
Define(vd, e)
|
Define(vd, e)
|
||||||
}
|
}
|
||||||
/* Fonction anonyme */
|
/* Fonction anonyme */
|
||||||
| BACKSLASH p=located(pattern) ARROW e=located(expression){
|
| BACKSLASH p=located(pattern) ARROW e=located(expression) {
|
||||||
Fun(FunctionDefinition(p, e))
|
Fun(FunctionDefinition(p, e))
|
||||||
}
|
}
|
||||||
/* Application */
|
/* Application */
|
||||||
|
|
Reference in a new issue