diff --git a/flap/src/hopix/hopixLexer.mll b/flap/src/hopix/hopixLexer.mll index b9fe033..0310fe5 100644 --- a/flap/src/hopix/hopixLexer.mll +++ b/flap/src/hopix/hopixLexer.mll @@ -53,6 +53,8 @@ let int = '-'? (digit+ | hexa+ | bina+ | octa+) (* Littéraux caractères *) let letter = (digit | ['A'-'Z'] | ['a'-'z']) +let ascii_trop_grand = '\\' ['3'-'9']['0'-'9'](['0'-'9'])+ + rule token = parse (** Layout *) | newline { next_line_and token lexbuf } @@ -134,6 +136,8 @@ rule token = parse in CHAR (Char.chr (code)) } *) (** Lexing error *) + (* erreur qui advient pour le test 22-char-literal, le code renvoie bizarrement que "Error (during lexing) "*) + | "'" ascii_trop_grand "'" { error lexbuf None "" } | _ as _c { error lexbuf None (* (Some _c) *) "unexpected character." } (* TODO: Gérer les imbrications de commentaires *) diff --git a/flap/src/hopix/hopixParser.mly b/flap/src/hopix/hopixParser.mly index 12bc3ed..bb03730 100644 --- a/flap/src/hopix/hopixParser.mly +++ b/flap/src/hopix/hopixParser.mly @@ -23,7 +23,6 @@ /* TODO: Résoudre tout les shift/reduce conflits */ %right WHILE REF DO - %left FUN MATCH IF FOR %right ARROW %right SEMICOLON @@ -327,10 +326,16 @@ 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]) + }*/ + /* Definition locale */ | vd=vdefinition SEMICOLON e=located(expression) { Define(vd, e) @@ -389,7 +394,7 @@ expression: } /* Reference - Allocation * ref expr */ -| REF e=located(expression) { +| REF e=located(simple_expression) { Ref(e) } /* Affectation