builtin-grep: remove unused debugging cruft.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Junio C Hamano committed
Aug 16, 2006 at 13:58 UTC
6493cc09c2aa626ffbe6024dd705e1495c2d87e4
1 file changed
-57
builtin-grep.c
-57
@@ -175,61 +175,12 @@ static void compile_regexp(struct grep_pat *p, struct grep_opt *opt)
175
}
176
}
177
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
-
178
static struct grep_expr *compile_pattern_expr(struct grep_pat **);
179
static struct grep_expr *compile_pattern_atom(struct grep_pat **list)
180
{
181
struct grep_pat *p;
182
struct grep_expr *x;
183
231
- looking_at("atom", list);
232
-
184
p = *list;
185
switch (p->token) {
186
case GREP_PATTERN: /* atom */
@@ -257,8 +208,6 @@ static struct grep_expr *compile_pattern_not(struct grep_pat **list)
208
struct grep_pat *p;
209
struct grep_expr *x;
210
260
- looking_at("not", list);
261
-
211
p = *list;
212
switch (p->token) {
213
case GREP_NOT:
@@ -281,8 +230,6 @@ static struct grep_expr *compile_pattern_and(struct grep_pat **list)
230
struct grep_pat *p;
231
struct grep_expr *x, *y, *z;
232
284
- looking_at("and", list);
285
-
233
x = compile_pattern_not(list);
234
p = *list;
235
if (p && p->token == GREP_AND) {
@@ -306,8 +253,6 @@ static struct grep_expr *compile_pattern_or(struct grep_pat **list)
253
struct grep_pat *p;
254
struct grep_expr *x, *y, *z;
255
309
- looking_at("or", list);
310
-
256
x = compile_pattern_and(list);
257
p = *list;
258
if (x && p && p->token != GREP_CLOSE_PAREN) {
@@ -325,8 +270,6 @@ static struct grep_expr *compile_pattern_or(struct grep_pat **list)
270
271
static struct grep_expr *compile_pattern_expr(struct grep_pat **list)
272
{
328
- looking_at("expr", list);
329
-
273
return compile_pattern_or(list);
274
}
275