`\bword\b` matcher (modifier keyword tests in languages/java.ts).
(word: &'static str)
| 1767 | |
| 1768 | /// `\bword\b` matcher (modifier keyword tests in languages/java.ts). |
| 1769 | fn word_re(word: &'static str) -> &'static Regex { |
| 1770 | static STATIC_RE: OnceLock<Regex> = OnceLock::new(); |
| 1771 | static FINAL_RE: OnceLock<Regex> = OnceLock::new(); |
| 1772 | match word { |
| 1773 | "static" => STATIC_RE.get_or_init(|| Regex::new(r"\bstatic\b").unwrap()), |
| 1774 | "final" => FINAL_RE.get_or_init(|| Regex::new(r"\bfinal\b").unwrap()), |
| 1775 | _ => unreachable!("word_re only supports static/final"), |
| 1776 | } |
| 1777 | } |
| 1778 | |
| 1779 | fn opt_str(arena: &mut Arena, s: Option<&str>) -> StrRef { |
| 1780 | match s { |
no test coverage detected