Replacing map_injection by injection(Map,binding).

This commit is contained in:
Christian Rinderknecht 2019-07-26 16:23:12 +02:00
parent 295f94a09a
commit 9b34b13e15

View File

@ -98,13 +98,6 @@ sepseq(X,Sep):
(**) { None } (**) { None }
| nsepseq(X,Sep) { Some $1 } | nsepseq(X,Sep) { Some $1 }
(* TODO *)
(*
sequence(Item,TERM):
nsepseq(Item,TERM) {}
| nseq(Item TERM {$1,$2}) {}
*)
(* Inlines *) (* Inlines *)
%inline var : Ident { $1 } %inline var : Ident { $1 }
@ -502,7 +495,7 @@ set_patch:
in {region; value}} in {region; value}}
map_patch: map_patch:
Patch path With map_injection { Patch path With injection(Map,binding) {
let region = cover $1 $4.region in let region = cover $1 $4.region in
let value = { let value = {
kwd_patch = $1; kwd_patch = $1;
@ -550,45 +543,6 @@ injection(Kind,element):
closing = RBracket $3} closing = RBracket $3}
in {region; value}} in {region; value}}
map_injection:
Map sep_or_term_list(binding,SEMI) End {
let elements, terminator = $2 in
let region = cover $1 $3
and value = {
opening = Kwd $1;
elements = Some elements;
terminator;
closing = End $3}
in {region; value}
}
| Map End {
let region = cover $1 $2
and value = {
opening = Kwd $1;
elements = None;
terminator = None;
closing = End $2}
in {region; value}
}
| Map LBRACKET sep_or_term_list(binding,SEMI) RBRACKET {
let elements, terminator = $3 in
let region = cover $1 $4
and value = {
opening = KwdBracket ($1,$2);
elements = Some elements;
terminator;
closing = RBracket $4}
in {region; value}
}
| Map LBRACKET RBRACKET {
let region = cover $1 $3
and value = {
opening = KwdBracket ($1,$2);
elements = None;
terminator = None;
closing = RBracket $3}
in {region; value}}
binding: binding:
expr ARROW expr { expr ARROW expr {
let start = expr_to_region $1 let start = expr_to_region $1
@ -958,7 +912,7 @@ set_expr:
map_expr: map_expr:
map_lookup { MapLookUp $1 } map_lookup { MapLookUp $1 }
| map_injection { MapInj $1 } | injection(Map,binding) { MapInj $1 }
map_lookup: map_lookup:
path brackets(expr) { path brackets(expr) {