Possibly removed the need for ensure_semicolon
This commit is contained in:
@@ -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(";");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user