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

Function cleaners

codegraph-kernel/src/docstring.rs:46–63  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

44}
45
46fn cleaners() -> &'static Cleaners {
47 static C: OnceLock<Cleaners> = OnceLock::new();
48 C.get_or_init(|| Cleaners {
49 block_open: Regex::new(r"^/\*+!?").unwrap(),
50 block_close: Regex::new(r"\*+/$").unwrap(),
51 lua_open: Regex::new(r"^--\[=*\[").unwrap(),
52 lua_close: Regex::new(r"\]=*\]$").unwrap(),
53 paren_star_open: Regex::new(r"^\(\*").unwrap(),
54 paren_star_close: Regex::new(r"\*\)$").unwrap(),
55 brace_open: Regex::new(r"^\{").unwrap(),
56 brace_close: Regex::new(r"\}$").unwrap(),
57 slashes: Regex::new(r"\A//[/!]?\s?").unwrap(),
58 dashes: Regex::new(r"\A--\s?").unwrap(),
59 hash: Regex::new(r"\A#\s?").unwrap(),
60 percent: Regex::new(r"\A%+\s?").unwrap(),
61 star_cont: Regex::new(r"\A\s*\*\s?").unwrap(),
62 })
63}
64
65/// JS multiline `^` anchors after \n, \r, U+2028, U+2029; the regex crate's
66/// `(?m)^` anchors after `\n` only. On CRLF content the JS engine finds a line

Callers 1

clean_comment_markersFunction · 0.85

Calls 1

unwrapMethod · 0.60

Tested by

no test coverage detected