This commit is contained in:
Mylloon 2023-10-20 19:10:39 +02:00
parent 7683cada98
commit 726daf228d
Signed by: Anri
GPG key ID: A82D63DFF8D1317F

View file

@ -352,12 +352,11 @@ expression:
} }
/* 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)
} } */
*/
/* if ( expr ) then { expr } else { expr } */ /* if ( expr ) then { expr } else { expr } */
| IF LPAREN e=located(expression) RPAREN | IF LPAREN e=located(expression) RPAREN
THEN LBRACE e2=located(expression) RBRACE THEN LBRACE e2=located(expression) RBRACE
@ -366,14 +365,12 @@ expression:
} }
/* Reference ref expr */ /* Reference ref expr */
| REF e=located(expression) { | REF e=located(expression) {
Ref(e) Ref(e)
} }
/* Affectation */ /* Affectation
/* expr := expr */ * expr := expr */
| e1=located(expression) ASSIGN e2=located(expression) { | e1=located(expression) ASSIGN e2=located(expression) {
Assign(e1, e2) Assign(e1, e2)
} }
@ -385,11 +382,12 @@ expression:
While(e, e2) While(e, e2)
} }
/* Do while TODO */ /* Do while
/* do { expr } until ( expr ) */ * do { expr } until ( expr ) */
/* 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
LBRACE e3=located(expression) RBRACE { LBRACE e3=located(expression) RBRACE {
@ -401,8 +399,8 @@ expression:
e e
} }
/* 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)
} }