Possibly removed the need for ensure_semicolon

This commit is contained in:
2026-07-02 06:33:17 +02:00
parent 68cf239f92
commit 4579c656b9
6 changed files with 20 additions and 54 deletions
-14
View File
@@ -4,13 +4,6 @@ use crate::fmt::{Context, GenMist, GetMist, MistCodegen};
impl GenMist for Expression {
fn gen_mist(&self, ctx: &mut Context, cg: &mut MistCodegen) {
let ensure_semicolon = if ctx.expr_ensure_semicolon {
ctx.expr_ensure_semicolon = false;
true
} else {
false
};
match self {
Expression::Path(path) => cg.add(&path.get_mist()),
Expression::Literal(literal) => literal.gen_mist(ctx, cg),
@@ -75,13 +68,6 @@ impl GenMist for Expression {
}
}
}
if ensure_semicolon {
ctx.expr_ensure_semicolon = true;
if !self.is_block() {
cg.add(";");
}
}
}
}