clean up weird grammar. not sure what i was thinking.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81
diff --git a/libexec/got-read-gotconfig/parse.y b/libexec/got-read-gotconfig/parse.y
index 0ee9552..c3899d0 100644
--- a/libexec/got-read-gotconfig/parse.y
+++ b/libexec/got-read-gotconfig/parse.y
@@ -233,8 +233,32 @@ remoteopts1 : REPOSITORY STRING {
| REFERENCE ref {
remote->ref = $2;
}
- | FETCH fetch
- | SEND send
+ | FETCH {
+ static const struct got_error* error;
+
+ if (remote->fetch_repo != NULL) {
+ yyerror("fetch block already exists");
+ YYERROR;
+ }
+ error = new_fetch(&remote->fetch_repo);
+ if (error) {
+ yyerror("%s", error->msg);
+ YYERROR;
+ }
+ } '{' optnl fetchopts2 '}'
+ | SEND {
+ static const struct got_error* error;
+
+ if (remote->send_repo != NULL) {
+ yyerror("send block already exists");
+ YYERROR;
+ }
+ error = new_send(&remote->send_repo);
+ if (error) {
+ yyerror("%s", error->msg);
+ YYERROR;
+ }
+ } '{' optnl sendopts2 '}'
;
fetchopts2 : fetchopts2 fetchopts1 nl
| fetchopts1 optnl
@@ -274,20 +298,6 @@ fetchopts1 : /* empty */
remote->fetch_repo->fetch_branch = $2;
}
;
-fetch : {
- static const struct got_error* error;
-
- if (remote->fetch_repo != NULL) {
- yyerror("fetch block already exists");
- YYERROR;
- }
- error = new_fetch(&remote->fetch_repo);
- if (error) {
- yyerror("%s", error->msg);
- YYERROR;
- }
- } '{' optnl fetchopts2 '}'
- ;
sendopts2 : sendopts2 sendopts1 nl
| sendopts1 optnl
;
@@ -326,20 +336,6 @@ sendopts1 : /* empty */
remote->send_repo->send_branch = $2;
}
;
-send : {
- static const struct got_error* error;
-
- if (remote->send_repo != NULL) {
- yyerror("send block already exists");
- YYERROR;
- }
- error = new_send(&remote->send_repo);
- if (error) {
- yyerror("%s", error->msg);
- YYERROR;
- }
- } '{' optnl sendopts2 '}'
- ;
remote : REMOTE STRING {
static const struct got_error* error;