Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit46825d4

Browse files
committed
Clean up some sloppy coding in repl_gram.y.
Remove unused copy-and-pasted macro definitions, and improve formattingof recently-added productions.I got interested in this because buildfarm member protosciurus has beencrashing in "bison repl_gram.y" since commit858ec11. It's a long shotthat this will fix that, though maybe the missing trailing semicolonhas something to do with it? In any case, there's no need to approveof dead code, nor of code whose formatting isn't even self-consistentlet alone consistent with what's around it.
1 parent0753bdb commit46825d4

File tree

1 file changed

+24
-25
lines changed

1 file changed

+24
-25
lines changed

‎src/backend/replication/repl_gram.y

Lines changed: 24 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,6 @@
2525
/* Result of the parsing is returned here*/
2626
Node *replication_parse_result;
2727

28-
/* Location tracking support --- simpler than bison's default*/
29-
#defineYYLLOC_DEFAULT(Current, Rhs, N) \
30-
do { \
31-
if (N) \
32-
(Current) = (Rhs)[1]; \
33-
else \
34-
(Current) = (Rhs)[0]; \
35-
}while (0)
3628

3729
/*
3830
* Bison doesn't allocate anything that needs to live across parser calls,
@@ -45,9 +37,6 @@ Node *replication_parse_result;
4537
#defineYYMALLOC palloc
4638
#defineYYFREE pfree
4739

48-
#defineparser_yyerror(msg) replication_yyerror(msg, yyscanner)
49-
#defineparser_errposition(pos) replication_scanner_errposition(pos)
50-
5140
%}
5241

5342
%expect0
@@ -91,6 +80,7 @@ Node *replication_parse_result;
9180
%type<defelt>base_backup_opt
9281
%type<uintval>opt_timeline
9382
%type<str>opt_slot
83+
9484
%%
9585

9686
firstcmd:commandopt_semicolon
@@ -134,34 +124,38 @@ base_backup:
134124
}
135125
;
136126

137-
base_backup_opt_list:base_backup_opt_listbase_backup_opt {$$ = lappend($1,$2); }
138-
|/* EMPTY*/{$$ = NIL; }
127+
base_backup_opt_list:
128+
base_backup_opt_listbase_backup_opt
129+
{$$ = lappend($1,$2); }
130+
|/* EMPTY*/
131+
{$$ = NIL; }
132+
;
139133

140134
base_backup_opt:
141135
K_LABELSCONST
142136
{
143137
$$ = makeDefElem("label",
144-
(Node *)makeString($2));
138+
(Node *)makeString($2));
145139
}
146140
|K_PROGRESS
147141
{
148142
$$ = makeDefElem("progress",
149-
(Node *)makeInteger(TRUE));
143+
(Node *)makeInteger(TRUE));
150144
}
151145
|K_FAST
152146
{
153147
$$ = makeDefElem("fast",
154-
(Node *)makeInteger(TRUE));
148+
(Node *)makeInteger(TRUE));
155149
}
156150
|K_WAL
157151
{
158152
$$ = makeDefElem("wal",
159-
(Node *)makeInteger(TRUE));
153+
(Node *)makeInteger(TRUE));
160154
}
161155
|K_NOWAIT
162156
{
163157
$$ = makeDefElem("nowait",
164-
(Node *)makeInteger(TRUE));
158+
(Node *)makeInteger(TRUE));
165159
}
166160
;
167161

@@ -214,7 +208,8 @@ opt_timeline:
214208
(errmsg("invalid timeline %u", $2))));
215209
$$ =$2;
216210
}
217-
|/* nothing*/{$$ =0; }
211+
|/* EMPTY*/
212+
{$$ =0; }
218213
;
219214

220215
/*
@@ -237,14 +232,18 @@ timeline_history:
237232
}
238233
;
239234

240-
opt_physical :K_PHYSICAL|/* EMPTY*/;
235+
opt_physical:
236+
K_PHYSICAL
237+
|/* EMPTY*/
238+
;
241239

240+
opt_slot:
241+
K_SLOTIDENT
242+
{$$ =$2; }
243+
|/* EMPTY*/
244+
{$$ =NULL; }
245+
;
242246

243-
opt_slot :K_SLOTIDENT
244-
{
245-
$$ =$2;
246-
}
247-
|/* nothing*/{$$ =NULL; }
248247
%%
249248

250249
#include"repl_scanner.c"

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp