Some improvements to the type system

This commit is contained in:
Fabian Stamm
2025-05-27 17:30:13 +02:00
parent 45ebb2c0d7
commit 0e73f7b5b3
6 changed files with 649 additions and 358 deletions

View File

@ -67,6 +67,24 @@ impl CompileContext {
result
}
pub fn strip_template_ignores(content: &str) -> String {
let mut result = String::new();
let mut ignore = false;
for line in content.lines() {
if ignore {
ignore = false;
continue;
}
if line.trim().contains("@template-ignore") {
ignore = true;
continue;
}
result.push_str(line);
result.push_str("\n");
}
result
}
pub fn write_file(&self, filename: &str, content: &str) -> Result<()> {
let res_path = self.output_folder.clone().join(filename);
let res_dir = res_path.parent().context("Path has no parent!")?;