refactor: function

This commit is contained in:
2025-05-10 20:01:56 +08:00
parent fa3193ea50
commit 046b03c60e
8 changed files with 293 additions and 277 deletions

View File

@@ -1,5 +1,111 @@
#![allow(unused_variables)]
use crate::ir::*;
use super::JITContext;
pub trait CodeGen {
fn codegen(self, ctx: JITContext);
fn codegen(self, ctx: &JITContext);
}
impl CodeGen for Attrs {
fn codegen(self, ctx: &JITContext) {
todo!()
}
}
impl CodeGen for List {
fn codegen(self, ctx: &JITContext) {
todo!()
}
}
impl CodeGen for HasAttr {
fn codegen(self, ctx: &JITContext) {
todo!()
}
}
impl CodeGen for BinOp {
fn codegen(self, ctx: &JITContext) {
todo!()
}
}
impl CodeGen for UnOp {
fn codegen(self, ctx: &JITContext) {
todo!()
}
}
impl CodeGen for Select {
fn codegen(self, ctx: &JITContext) {
todo!()
}
}
impl CodeGen for If {
fn codegen(self, ctx: &JITContext) {
todo!()
}
}
impl CodeGen for LoadFunc {
fn codegen(self, ctx: &JITContext) {
todo!()
}
}
impl CodeGen for Call {
fn codegen(self, ctx: &JITContext) {
todo!()
}
}
impl CodeGen for Let {
fn codegen(self, ctx: &JITContext) {
todo!()
}
}
impl CodeGen for With {
fn codegen(self, ctx: &JITContext) {
todo!()
}
}
impl CodeGen for Assert {
fn codegen(self, ctx: &JITContext) {
todo!()
}
}
impl CodeGen for ConcatStrings {
fn codegen(self, ctx: &JITContext) {
todo!()
}
}
impl CodeGen for Const {
fn codegen(self, ctx: &JITContext) {
todo!()
}
}
impl CodeGen for Var {
fn codegen(self, ctx: &JITContext) {
todo!()
}
}
impl CodeGen for Thunk {
fn codegen(self, ctx: &JITContext) {
todo!()
}
}
impl CodeGen for Path {
fn codegen(self, ctx: &JITContext) {
todo!()
}
}