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