MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / word_re

Function word_re

codegraph-kernel/src/java.rs:1606–1614  ·  view source on GitHub ↗

`\bword\b` matcher (modifier keyword tests in languages/java.ts).

(word: &'static str)

Source from the content-addressed store, hash-verified

1604
1605/// `\bword\b` matcher (modifier keyword tests in languages/java.ts).
1606fn word_re(word: &'static str) -> &'static Regex {
1607 static STATIC_RE: OnceLock<Regex> = OnceLock::new();
1608 static FINAL_RE: OnceLock<Regex> = OnceLock::new();
1609 match word {
1610 "static" => STATIC_RE.get_or_init(|| Regex::new(r"\bstatic\b").unwrap()),
1611 "final" => FINAL_RE.get_or_init(|| Regex::new(r"\bfinal\b").unwrap()),
1612 _ => unreachable!("word_re only supports static/final"),
1613 }
1614}
1615
1616fn opt_str(arena: &mut Arena, s: Option<&str>) -> StrRef {
1617 match s {

Callers 2

is_constMethod · 0.85

Calls 1

unwrapMethod · 0.60

Tested by

no test coverage detected