@@ -175,61 +175,12 @@ static void compile_regexp(struct grep_pat *p, struct grep_opt *opt)
175
175
}
176
176
}
177
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
-
225
178
static struct grep_expr * compile_pattern_expr (struct grep_pat * * );
226
179
static struct grep_expr * compile_pattern_atom (struct grep_pat * * list )
227
180
{
228
181
struct grep_pat * p ;
229
182
struct grep_expr * x ;
230
183
231
- looking_at ("atom" , list );
232
-
233
184
p = * list ;
234
185
switch (p -> token ) {
235
186
case GREP_PATTERN : /* atom */
@@ -257,8 +208,6 @@ static struct grep_expr *compile_pattern_not(struct grep_pat **list)
257
208
struct grep_pat * p ;
258
209
struct grep_expr * x ;
259
210
260
- looking_at ("not" , list );
261
-
262
211
p = * list ;
263
212
switch (p -> token ) {
264
213
case GREP_NOT :
@@ -281,8 +230,6 @@ static struct grep_expr *compile_pattern_and(struct grep_pat **list)
281
230
struct grep_pat * p ;
282
231
struct grep_expr * x , * y , * z ;
283
232
284
- looking_at ("and" , list );
285
-
286
233
x = compile_pattern_not (list );
287
234
p = * list ;
288
235
if (p && p -> token == GREP_AND ) {
@@ -306,8 +253,6 @@ static struct grep_expr *compile_pattern_or(struct grep_pat **list)
306
253
struct grep_pat * p ;
307
254
struct grep_expr * x , * y , * z ;
308
255
309
- looking_at ("or" , list );
310
-
311
256
x = compile_pattern_and (list );
312
257
p = * list ;
313
258
if (x && p && p -> token != GREP_CLOSE_PAREN ) {
@@ -325,8 +270,6 @@ static struct grep_expr *compile_pattern_or(struct grep_pat **list)
325
270
326
271
static struct grep_expr * compile_pattern_expr (struct grep_pat * * list )
327
272
{
328
- looking_at ("expr" , list );
329
-
330
273
return compile_pattern_or (list );
331
274
}
332
275
0 commit comments