Chapter 10 done

This commit is contained in:
Moritz Gmeiner 2023-01-25 19:01:13 +01:00
commit 46f1030207
16 changed files with 1173 additions and 201 deletions

View file

@ -23,3 +23,12 @@ impl Debug for CodePos {
write!(f, "{}:{}", self.line, self.col)
}
}
/*====================================================================================================================*/
pub fn indent(s: String) -> String {
s.split('\n')
.map(|line| format!("\t{line}"))
.collect::<Vec<String>>()
.join("\n")
}