True when node consumes input[pos] as a single codepoint. */
(&self, node: &Node, pos: usize)
| 208 | |
| 209 | /* True when node consumes input[pos] as a single codepoint. */ |
| 210 | fn single_match(&self, node: &Node, pos: usize) -> bool { |
| 211 | let c = self.input[pos]; |
| 212 | match node { |
| 213 | Node::Char(want) => self.ci_eq(c, *want), |
| 214 | Node::AnyChar => self.flags.dotall || c != '\n', |
| 215 | Node::Class { items, negated } => { |
| 216 | let hit = self.class_hit(items, c); |
| 217 | hit != *negated |
| 218 | } |
| 219 | _ => false, |
| 220 | } |
| 221 | } |
| 222 | |
| 223 | /* Class membership, widening by case when ignorecase is set. */ |
| 224 | fn class_hit(&self, items: &[ClassItem], c: char) -> bool { |
no test coverage detected