| 654 | } |
| 655 | |
| 656 | static struct grep_expr *compile_pattern_and(struct grep_pat **list) |
| 657 | { |
| 658 | struct grep_pat *p; |
| 659 | struct grep_expr *x, *y; |
| 660 | |
| 661 | x = compile_pattern_not(list); |
| 662 | p = *list; |
| 663 | if (p && p->token == GREP_AND) { |
| 664 | if (!x) |
| 665 | die("--and not preceded by pattern expression"); |
| 666 | if (!p->next) |
| 667 | die("--and not followed by pattern expression"); |
| 668 | *list = p->next; |
| 669 | y = compile_pattern_and(list); |
| 670 | if (!y) |
| 671 | die("--and not followed by pattern expression"); |
| 672 | return grep_and_expr(x, y); |
| 673 | } |
| 674 | return x; |
| 675 | } |
| 676 | |
| 677 | static struct grep_expr *compile_pattern_or(struct grep_pat **list) |
| 678 | { |
no test coverage detected