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

Function collect_source_files

build.rs:86–104  ·  view source on GitHub ↗

Walk `programs/` and record every `.hll` keyed by its forward-slash, repo-relative path. These back WASM-safe relative-import resolution where the filesystem is unavailable.

(dir: &Path, manifest_dir: &Path, out: &mut Vec<SourceFile>)

Source from the content-addressed store, hash-verified

84 files.push(path);
85 }
86 }
87 }
88}
89
90fn module_name_for(path: &Path) -> String {
91 path.with_extension("")
92 .components()
93 .map(|component| component.as_os_str().to_string_lossy())
94 .collect::<Vec<_>>()
95 .join("_")
96 .chars()
97 .map(|ch| if ch.is_ascii_alphanumeric() { ch } else { '_' })
98 .collect()
99}
100
101fn generate_userspace(manifest_dir: &Path, out_dir: &Path) {
102 let user_dir = manifest_dir.join("programs/user");
103 println!("cargo:rerun-if-changed={}", user_dir.display());
104
105 let mut build_files = Vec::new();
106 collect_build_files(&user_dir, &mut build_files);
107 build_files.sort();

Callers 1

generate_userspaceFunction · 0.85

Calls 2

pathMethod · 0.80
pushMethod · 0.80

Tested by

no test coverage detected