diff --git a/flap/src/hopix/hopixParser.mly b/flap/src/hopix/hopixParser.mly index 2b66710..06b288f 100644 --- a/flap/src/hopix/hopixParser.mly +++ b/flap/src/hopix/hopixParser.mly @@ -171,10 +171,6 @@ simple_pattern: | l=pattern_list { match l with | [alone] -> Position.value alone | _ -> PTuple(l) } -/* Annotation de type */ -| p=located(simple_pattern) COLON ty=located(ty) { - PTypeAnnotation(p, ty) - } /* Entier / Caractère / String */ | l=located(literal) { PLiteral l @@ -183,6 +179,15 @@ simple_pattern: | const=located(constructor) tl=option(type_list) pl=optionlist(pattern_list) { PTaggedValue(const, tl, pl) } + +pattern: +| p1=simple_pattern { + p1 + } +/* Annotation de type */ +| p=located(simple_pattern) COLON ty=located(ty) { + PTypeAnnotation(p, ty) + } /* Enregistrement */ | LBRACE l=separated_nonempty_list( COMMA, @@ -190,11 +195,6 @@ simple_pattern: ) RBRACE tl=option(type_list) { PRecord(l, tl) } - -pattern: -| p1=simple_pattern { - p1 - } /* Disjonction */ | p1=located(simple_pattern) PIPE p_list=separated_nonempty_list(PIPE, located(simple_pattern)) {