NO CONFLICT
This commit is contained in:
parent
77e713191d
commit
27ed7ebddb
1 changed files with 9 additions and 5 deletions
|
@ -17,6 +17,7 @@
|
|||
|
||||
%start<HopixAST.t> program
|
||||
|
||||
%left constr
|
||||
%left LPAREN
|
||||
|
||||
%left STRING
|
||||
|
@ -288,15 +289,13 @@ simple_expression:
|
|||
(* S'il y a qu'1 élément, alors c'est juste une expression *)
|
||||
match el with | [alone] -> Position.value alone | _ -> Tuple(el)
|
||||
}
|
||||
|
||||
mid_expression:
|
||||
| e=simple_expression {
|
||||
e
|
||||
}
|
||||
/* Tagged Value - Construction d'une donnée
|
||||
* TODO: Conflict shift/reduce sur le expr_list */
|
||||
| const=located(constructor) tl=option(type_list) el=optionlist(expr_list) {
|
||||
Tagged(const, tl, el)
|
||||
/* Tagged Value - Déclaration d'une donnée */
|
||||
| const=located(constructor) tl=option(type_list) %prec constr {
|
||||
Tagged(const, tl, [])
|
||||
}
|
||||
/* Application */
|
||||
| e1=located(mid_expression) e2=located(mid_expression) %prec app1 {
|
||||
|
@ -315,6 +314,7 @@ mid_expression:
|
|||
Record(l, tl)
|
||||
}
|
||||
|
||||
|
||||
expression:
|
||||
| e=mid_expression {
|
||||
e
|
||||
|
@ -328,6 +328,10 @@ expression:
|
|||
| LPAREN RPAREN {
|
||||
Tuple([])
|
||||
}
|
||||
/* Tagged Value - Construction d'une donnée */
|
||||
| const=located(constructor) tl=option(type_list) el=expr_list {
|
||||
Tagged(const, tl, el)
|
||||
}
|
||||
/* Sequence - Séquencement */
|
||||
| e=located(expression) SEMICOLON e2=located(expression) {
|
||||
Sequence([e; e2])
|
||||
|
|
Reference in a new issue