mirror of
https://github.com/MorizzG/rlox.git
synced 2025-12-06 12:22:42 +00:00
Chapter 10 done
This commit is contained in:
parent
956c4d0f28
commit
46f1030207
16 changed files with 1173 additions and 201 deletions
|
|
@ -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")
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue