Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- pub fn preprocess(&self, src: &str) -> String {
- let reg = r#"\#include\("(.+.wgsl)"\);"#;
- let re = Regex::new(reg).unwrap();
- let processed = re.replace_all(src, |caps: &Captures| {
- let filename = caps[1].to_owned();
- let file_path = self.root.join(filename);
- let contents = fs::read_to_string(file_path).unwrap();
- contents
- });
- processed.to_string()
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement