(expr)
| 18245 | |
| 18246 | // Helper to check if a LabelOr chain is just simple labels (no AND, NOT, wildcard) |
| 18247 | function isSimpleOrChain(expr) { |
| 18248 | if (expr.type === 'LabelName') return true; |
| 18249 | if (expr.type === 'LabelOr') { |
| 18250 | return isSimpleOrChain(expr.left) && isSimpleOrChain(expr.right); |
| 18251 | } |
| 18252 | return false; |
| 18253 | } |
| 18254 | |
| 18255 | // Flatten simple OR chain to array of label names |
| 18256 | function flattenSimpleOrChain(expr) { |