conflits?

This commit is contained in:
Mylloon 2023-10-21 00:36:46 +02:00
parent 8ed2b0c51f
commit 5692c73984
Signed by: Anri
GPG key ID: A82D63DFF8D1317F

View file

@ -55,7 +55,7 @@ tdefinition:
/* la définition étant assez compliqué, on va utilisé d'autre terme pour réduire la taille */ /* la définition étant assez compliqué, on va utilisé d'autre terme pour réduire la taille */
| option(PIPE) l=separated_nonempty_list(PIPE,list_constructor_and_ty) { | option(PIPE) l=separated_nonempty_list(PIPE,list_constructor_and_ty) {
DefineSumType(l) DefineSumType(l)
} }
/* Type produit étiqueté */ /* Type produit étiqueté */
| LBRACE lt=separated_nonempty_list(COMMA, label_with_type) RBRACE { | LBRACE lt=separated_nonempty_list(COMMA, label_with_type) RBRACE {
DefineRecordType(lt) DefineRecordType(lt)
@ -354,41 +354,17 @@ expression:
Apply(e1, e2) Apply(e1, e2)
} }
<<<<<<< HEAD
=======
/* TODO operation binaire mais j'ai pas très bien compris encore */
>>>>>>> 726daf228d20fae695ecf903491c8b62d9e6a673
/* Match (exp) {| ...| ... | ...} */ /* Match (exp) {| ...| ... | ...} */
| MATCH LPAREN e=located(expression) RPAREN LBRACE b=branches RBRACE { | MATCH LPAREN e=located(expression) RPAREN LBRACE b=branches RBRACE {
Case(e, b) Case(e, b)
} }
<<<<<<< HEAD
/* TODO if ( exp ) then { expr } j'ai RIEN COMPRIS */
/*
| IF LPAREN e=located(expression) RPAREN
THEN LBRACE e2=located(expression) RBRACE{
IfThenElse(e,e2,Position.unknown_pos )
}
*/
/* if ( expr ) then { expr } else { expr } */
| IF LPAREN e=located(expression) RPAREN
THEN LBRACE e2=located(expression) RBRACE
ELSE LBRACE e3=located(expression) RBRACE {
IfThenElse(e,e2,e3)
}
/* Reference ref expr */
=======
/* TODO if ( exp ) then { expr } j'ai RIEN COMPRIS */ /* TODO if ( exp ) then { expr } j'ai RIEN COMPRIS */
/* | IF LPAREN e=located(expression) RPAREN /* | IF LPAREN e=located(expression) RPAREN
THEN LBRACE e2=located(expression) RBRACE { THEN LBRACE e2=located(expression) RBRACE {
IfThenElse(e, e2, None) IfThenElse(e, e2, None)
} */ } */
>>>>>>> 726daf228d20fae695ecf903491c8b62d9e6a673
/* if ( expr ) then { expr } else { expr } */ /* if ( expr ) then { expr } else { expr } */
| IF LPAREN e=located(expression) RPAREN | IF LPAREN e=located(expression) RPAREN
@ -419,7 +395,7 @@ expression:
* do { expr } until ( expr ) */ * do { expr } until ( expr ) */
/* TODO */ /* TODO */
/* boucle for /* Boucle for
* for x in (e1 to e2) { expr } */ * for x in (e1 to e2) { expr } */
| FOR x=located(identifier) | FOR x=located(identifier)
FROM LPAREN e1=located(expression) RPAREN TO LPAREN e2=located(expression) RPAREN FROM LPAREN e1=located(expression) RPAREN TO LPAREN e2=located(expression) RPAREN
@ -432,30 +408,17 @@ expression:
e e
} }
<<<<<<< HEAD
/* Annotation de type */
/* (e : ty) */
| LPAREN e=located(expression) COLON t=located(ty) RPAREN {
TypeAnnotation(e,t)
=======
/* Annotation de type /* Annotation de type
* (e : ty) */ * (e : ty) */
| LPAREN e=located(expression) COLON t=located(ty) RPAREN { | LPAREN e=located(expression) COLON t=located(ty) RPAREN {
TypeAnnotation(e, t) TypeAnnotation(e, t)
>>>>>>> 726daf228d20fae695ecf903491c8b62d9e6a673
} }
/* operateurs binaires */ /* Operateurs binaires */
/* | e1=located(expression) b=binop e2=located(expression) {
/* Apply(Apply(b,e1),e2)
| e1=located(expression) b=binop e2=located(expression) { } */
Apply(Apply(b,e1),e2)
}*/