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

Function cleaners

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

Source from the content-addressed store, hash-verified

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