fix Pattern Tuple issue, add to much ( and )
This commit is contained in:
parent
556f637cf6
commit
f8d9068012
1 changed files with 9 additions and 4 deletions
|
@ -167,9 +167,14 @@ simple_pattern:
|
||||||
PWildcard
|
PWildcard
|
||||||
}
|
}
|
||||||
/* N-uplets ou parenthésage */
|
/* N-uplets ou parenthésage */
|
||||||
| LPAREN p=optionlist(separated_nonempty_list(COMMA, located(pattern))) RPAREN {
|
| LPAREN RPAREN {
|
||||||
PTuple(p)
|
PTuple([])
|
||||||
}
|
}
|
||||||
|
| l=pattern_list {
|
||||||
|
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) {
|
||||||
PTypeAnnotation(p, ty)
|
PTypeAnnotation(p, ty)
|
||||||
|
@ -341,7 +346,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