Some improvements to the type system
This commit is contained in:
@ -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!")?;
|
||||
|
Reference in New Issue
Block a user