ParseAll parses each filter in ss and returns a filter that will return true if any filter matches the expression. If no filters are provided, the filter will match anything.
(ss ...string)
| 61 | // |
| 62 | // If no filters are provided, the filter will match anything. |
| 63 | func ParseAll(ss ...string) (Filter, error) { |
| 64 | if len(ss) == 0 { |
| 65 | return Always, nil |
| 66 | } |
| 67 | |
| 68 | var fs []Filter |
| 69 | for _, s := range ss { |
| 70 | f, err := Parse(s) |
| 71 | if err != nil { |
| 72 | return nil, fmt.Errorf("%s: %w", err.Error(), errdefs.ErrInvalidArgument) |
| 73 | } |
| 74 | |
| 75 | fs = append(fs, f) |
| 76 | } |
| 77 | |
| 78 | return Any(fs), nil |
| 79 | } |
| 80 | |
| 81 | type parser struct { |
| 82 | input string |
searching dependent graphs…