Super and super

This commit is contained in:
2026-06-07 03:36:02 +02:00
parent e70e813497
commit fa4a7ee4c7
4 changed files with 48 additions and 2 deletions
+6
View File
@@ -7,6 +7,7 @@ use mist_parser::ast::*;
pub struct Context {
pub expr_ensure_semicolon: bool,
pub expr_super: Option<Path>,
}
pub trait GenRust {
@@ -15,6 +16,10 @@ pub trait GenRust {
pub trait GetRust {
fn get_rust(&self) -> String;
fn get_rust_ctx(&self, cx: &mut Context) -> String {
let _ = cx;
self.get_rust()
}
}
#[derive(Default)]
@@ -57,6 +62,7 @@ impl RustCodegen {
pub fn generate(&mut self, toplevels: Vec<TopLevel>) -> String {
let mut ctx = Context {
expr_ensure_semicolon: true,
expr_super: None,
};
for tl in toplevels {