MCPcopy Create free account
hub / github.com/LPC4/Full-Stack / normalize_lexical

Function normalize_lexical

src/compilation_pipeline.rs:1356–1370  ·  view source on GitHub ↗

Resolve `.` and `..` components lexically, without touching the filesystem.

(path: &Path)

Source from the content-addressed store, hash-verified

1354 if !found && part == "programs" {
1355 found = true;
1356 }
1357 if found {
1358 parts.push(part.to_string_lossy().into_owned());
1359 }
1360 }
1361 }
1362 found.then(|| parts.join("/"))
1363}
1364
1365fn sanitize_artifact_component(value: &str) -> String {
1366 let mut out = String::with_capacity(value.len());
1367 for ch in value.chars() {
1368 if ch.is_ascii_alphanumeric() || matches!(ch, '_' | '-' | '.') {
1369 out.push(ch);
1370 } else {
1371 out.push('_');
1372 }
1373 }

Callers 1

resolve_module_sourceMethod · 0.85

Calls 2

popMethod · 0.80
pushMethod · 0.80

Tested by

no test coverage detected