| 632 | } |
| 633 | |
| 634 | static struct grep_expr *compile_pattern_not(struct grep_pat **list) |
| 635 | { |
| 636 | struct grep_pat *p; |
| 637 | struct grep_expr *x; |
| 638 | |
| 639 | p = *list; |
| 640 | if (!p) |
| 641 | return NULL; |
| 642 | switch (p->token) { |
| 643 | case GREP_NOT: |
| 644 | if (!p->next) |
| 645 | die("--not not followed by pattern expression"); |
| 646 | *list = p->next; |
| 647 | x = compile_pattern_not(list); |
| 648 | if (!x) |
| 649 | die("--not followed by non pattern expression"); |
| 650 | return grep_not_expr(x); |
| 651 | default: |
| 652 | return compile_pattern_atom(list); |
| 653 | } |
| 654 | } |
| 655 | |
| 656 | static struct grep_expr *compile_pattern_and(struct grep_pat **list) |
| 657 | { |
no test coverage detected