`\bword\b` matcher (modifier keyword tests in languages/java.ts).
(word: &'static str)
| 1593 | |
| 1594 | /// `\bword\b` matcher (modifier keyword tests in languages/java.ts). |
| 1595 | fn word_re(word: &'static str) -> &'static Regex { |
| 1596 | static STATIC_RE: OnceLock<Regex> = OnceLock::new(); |
| 1597 | static FINAL_RE: OnceLock<Regex> = OnceLock::new(); |
| 1598 | match word { |
| 1599 | "static" => STATIC_RE.get_or_init(|| Regex::new(r"\bstatic\b").unwrap()), |
| 1600 | "final" => FINAL_RE.get_or_init(|| Regex::new(r"\bfinal\b").unwrap()), |
| 1601 | _ => unreachable!("word_re only supports static/final"), |
| 1602 | } |
| 1603 | } |
| 1604 | |
| 1605 | fn opt_str(arena: &mut Arena, s: Option<&str>) -> StrRef { |
| 1606 | match s { |
no test coverage detected