Skip to content

Commit 6493cc0

Browse files
author
Junio C Hamano
committed
builtin-grep: remove unused debugging cruft.
Signed-off-by: Junio C Hamano <[email protected]>
1 parent e79ca7c commit 6493cc0

File tree

1 file changed

+0
-57
lines changed

1 file changed

+0
-57
lines changed

builtin-grep.c

Lines changed: 0 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -175,61 +175,12 @@ static void compile_regexp(struct grep_pat *p, struct grep_opt *opt)
175175
}
176176
}
177177

178-
#if DEBUG
179-
static inline void indent(int in)
180-
{
181-
int i;
182-
for (i = 0; i < in; i++) putchar(' ');
183-
}
184-
185-
static void dump_pattern_exp(struct grep_expr *x, int in)
186-
{
187-
switch (x->node) {
188-
case GREP_NODE_ATOM:
189-
indent(in);
190-
puts(x->u.atom->pattern);
191-
break;
192-
case GREP_NODE_NOT:
193-
indent(in);
194-
puts("--not");
195-
dump_pattern_exp(x->u.unary, in+1);
196-
break;
197-
case GREP_NODE_AND:
198-
dump_pattern_exp(x->u.binary.left, in+1);
199-
indent(in);
200-
puts("--and");
201-
dump_pattern_exp(x->u.binary.right, in+1);
202-
break;
203-
case GREP_NODE_OR:
204-
dump_pattern_exp(x->u.binary.left, in+1);
205-
indent(in);
206-
puts("--or");
207-
dump_pattern_exp(x->u.binary.right, in+1);
208-
break;
209-
}
210-
}
211-
212-
static void looking_at(const char *msg, struct grep_pat **list)
213-
{
214-
struct grep_pat *p = *list;
215-
fprintf(stderr, "%s: looking at ", msg);
216-
if (!p)
217-
fprintf(stderr, "empty\n");
218-
else
219-
fprintf(stderr, "<%s>\n", p->pattern);
220-
}
221-
#else
222-
#define looking_at(a,b) do {} while(0)
223-
#endif
224-
225178
static struct grep_expr *compile_pattern_expr(struct grep_pat **);
226179
static struct grep_expr *compile_pattern_atom(struct grep_pat **list)
227180
{
228181
struct grep_pat *p;
229182
struct grep_expr *x;
230183

231-
looking_at("atom", list);
232-
233184
p = *list;
234185
switch (p->token) {
235186
case GREP_PATTERN: /* atom */
@@ -257,8 +208,6 @@ static struct grep_expr *compile_pattern_not(struct grep_pat **list)
257208
struct grep_pat *p;
258209
struct grep_expr *x;
259210

260-
looking_at("not", list);
261-
262211
p = *list;
263212
switch (p->token) {
264213
case GREP_NOT:
@@ -281,8 +230,6 @@ static struct grep_expr *compile_pattern_and(struct grep_pat **list)
281230
struct grep_pat *p;
282231
struct grep_expr *x, *y, *z;
283232

284-
looking_at("and", list);
285-
286233
x = compile_pattern_not(list);
287234
p = *list;
288235
if (p && p->token == GREP_AND) {
@@ -306,8 +253,6 @@ static struct grep_expr *compile_pattern_or(struct grep_pat **list)
306253
struct grep_pat *p;
307254
struct grep_expr *x, *y, *z;
308255

309-
looking_at("or", list);
310-
311256
x = compile_pattern_and(list);
312257
p = *list;
313258
if (x && p && p->token != GREP_CLOSE_PAREN) {
@@ -325,8 +270,6 @@ static struct grep_expr *compile_pattern_or(struct grep_pat **list)
325270

326271
static struct grep_expr *compile_pattern_expr(struct grep_pat **list)
327272
{
328-
looking_at("expr", list);
329-
330273
return compile_pattern_or(list);
331274
}
332275

0 commit comments

Comments
 (0)