(Evaluator left, char combinator, Evaluator right)
| 149 | } |
| 150 | |
| 151 | static Evaluator combinator(Evaluator left, char combinator, Evaluator right) { |
| 152 | switch (combinator) { |
| 153 | case '>': |
| 154 | ImmediateParentRun run = left instanceof ImmediateParentRun ? |
| 155 | (ImmediateParentRun) left : new ImmediateParentRun(left); |
| 156 | run.add(right); |
| 157 | return run; |
| 158 | case ' ': |
| 159 | return and(new StructuralEvaluator.Ancestor(left), right); |
| 160 | case '+': |
| 161 | return and(new StructuralEvaluator.ImmediatePreviousSibling(left), right); |
| 162 | case '~': |
| 163 | return and(new StructuralEvaluator.PreviousSibling(left), right); |
| 164 | default: |
| 165 | throw new Selector.SelectorParseException("Unknown combinator '%s'", combinator); |
| 166 | } |
| 167 | } |
| 168 | |
| 169 | @Nullable Evaluator parseSubclass() { |
| 170 | // Subclass: ID | Class | Attribute | Pseudo |
no test coverage detected