brahmaputra 2

This commit is contained in:
mlokr 2024-07-07 14:29:37 +02:00
parent e9589ebcae
commit bd7384123c
No known key found for this signature in database
GPG key ID: DEA147DDEE644993
2 changed files with 4 additions and 9 deletions

View file

@ -1274,12 +1274,6 @@ struct StringReloc {
shifted: bool,
}
impl StringReloc {
fn range(&self) -> std::ops::Range<usize> {
self.range.start as _..self.range.end as _
}
}
#[derive(Default)]
pub struct Codegen {
pub files: Vec<parser::Ast>,

View file

@ -879,11 +879,12 @@ impl<'a> std::fmt::Display for Expr<'a> {
writeln!(f)?;
INDENT.with(|i| i.set(i.get() + 1));
let res = (|| {
for stmt in list {
for stmt in stmts {
for _ in 0..INDENT.with(|i| i.get()) {
write!(f, "\t")?;
}
fmt(stmt, f)?;
stmt.fmt(f)?;
writeln!(f)?;
}
Ok(())
})();
@ -891,7 +892,7 @@ impl<'a> std::fmt::Display for Expr<'a> {
for _ in 0..INDENT.with(|i| i.get()) {
write!(f, "\t")?;
}
write!(f, "{end}")?;
write!(f, "}}")?;
res
}
Self::Number { value, .. } => write!(f, "{value}"),