From ede3bcd07cdf28722c6fdc9975c3de88a28173b9 Mon Sep 17 00:00:00 2001 From: Mylloon Date: Mon, 23 Oct 2023 19:22:02 +0200 Subject: [PATCH] fmt --- flap/src/hopix/hopixParser.mly | 32 +++++++++++--------------------- 1 file changed, 11 insertions(+), 21 deletions(-) diff --git a/flap/src/hopix/hopixParser.mly b/flap/src/hopix/hopixParser.mly index c36d05c..20f3868 100644 --- a/flap/src/hopix/hopixParser.mly +++ b/flap/src/hopix/hopixParser.mly @@ -1,7 +1,6 @@ %{ (* -*- tuareg -*- *) open HopixAST - (* open Position *) %} @@ -16,29 +15,23 @@ %token CHAR - - %start program /* TODO: Résoudre tout les shift/reduce conflits */ - %left FUN -%left STRING +%left STRING %left INT -%right WHILE REF DO +%right WHILE REF DO %left LET MATCH IF FOR -%right ARROW -%right SEMICOLON -%left ASSIGN +%right ARROW +%right SEMICOLON +%left ASSIGN %left LPAREN %left BACKSLASH +%left EXCLA COLON - -%left EXCLA COLON - -/* priorités binop */ - +/* Priorités binop */ %left D_OR %left D_AND %left EQUAL_OP INF_EQUAL_OP INF_OP SUP_EQUAL_OP SUP_OP @@ -123,7 +116,7 @@ vdefinition: /* Valeur simple */ | LET i=located(identifier) ts=option(vdef_type_scheme) EQUAL e=located(expression) %prec let1 { - SimpleValue(i, ts, e) + SimpleValue(i, ts, e) } /* Fonction(s) * Exemple : @@ -332,16 +325,13 @@ expression: } /* Sequence - Séquencement * * Pas sûr, voir s'il ne faut pas une troisième couche d'expression */ - | e=located(simple_expression) SEMICOLON e_list=separated_nonempty_list(SEMICOLON, located(simple_expression)) { Sequence(e :: e_list) } - /* - |e1=located(expression) SEMICOLON e2=located(expression){ - Sequence([e1;e2]) - }*/ - +/* | e1=located(expression) SEMICOLON e2=located(expression) { + Sequence([e1; e2]) + } */ /* Definition locale */ | vd=vdefinition SEMICOLON e=located(expression) { Define(vd, e)