MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / outside_single_quotes

Function outside_single_quotes

crates/openshell-core/src/forward.rs:1217–1230  ·  view source on GitHub ↗

Helper: return the concatenation of characters that appear outside POSIX single-quoted runs. Used by the metacharacter assertions above.

(s: &str)

Source from the content-addressed store, hash-verified

1215 /// Helper: return the concatenation of characters that appear outside
1216 /// POSIX single-quoted runs. Used by the metacharacter assertions above.
1217 fn outside_single_quotes(s: &str) -> String {
1218 let mut out = String::new();
1219 let mut inside = false;
1220 for c in s.chars() {
1221 if c == '\'' {
1222 inside = !inside;
1223 continue;
1224 }
1225 if !inside {
1226 out.push(c);
1227 }
1228 }
1229 out
1230 }
1231
1232 #[test]
1233 fn build_sandbox_notes_with_forwards() {

Callers

nothing calls this directly

Calls 1

pushMethod · 0.80

Tested by

no test coverage detected