Plan for redo

This commit is contained in:
2026-06-07 00:02:06 +02:00
parent 5e5d22f3c5
commit 7acef24e09
+83 -4
View File
@@ -120,7 +120,8 @@ pub fn class_decl(
column: 1,
item: Expression::Statement(Box::new(Statement::Block(Block {
is_unsafe: true,
statements: vec![Spanned {
statements: vec![
Spanned {
line: 1,
column: 1,
item: Expression::Statement(Box::new(Statement::VarDecl(
@@ -150,7 +151,8 @@ pub fn class_decl(
Identifier(String::from("add")),
None,
),
Postfix::Call(vec![Expression::Path(ExprPath(vec![
Postfix::Call(vec![Expression::Path(ExprPath(
vec![
ExprPathSegment {
ident: Identifier(String::from("Self")),
generics: None,
@@ -162,12 +164,89 @@ pub fn class_decl(
)),
generics: None,
},
]))]),
],
))]),
],
}),
},
))),
}],
},
Spanned {
line: 1,
column: 1,
item: Expression::Statement(Box::new(Statement::VarDecl(
VarDeclStmt {
decl: VarDecl {
name: Pattern::Path(
false,
Path(vec![Identifier(String::from("func"))]),
),
type_: Some(TypeExpr::StaticFn(
method
.item
.params
.0
.clone()
.into_iter()
.filter_map(|v| {
Some(match v.type_? {
TypeExpr::Ref {
lifetime,
mutable,
ty,
} => {
}
TypeExpr::Path(p, g) => {
if g.is_some() {}
}
a => a,
})
})
.collect(),
)),
},
init: Some(Expression::Fix {
initial: Box::new(Expression::Path(ExprPath(vec![
ExprPathSegment {
ident: Identifier(String::from("self")),
generics: None,
},
]))),
prefixes: vec![Prefix::Deref],
postfixes: vec![
Postfix::FieldAccess(
Identifier(String::from("_m_oop")),
None,
),
Postfix::TupleFieldAccess(0, None),
Postfix::FieldAccess(
Identifier(String::from("add")),
None,
),
Postfix::Call(vec![Expression::Path(ExprPath(
vec![
ExprPathSegment {
ident: Identifier(String::from("Self")),
generics: None,
},
ExprPathSegment {
ident: Identifier(format!(
"__FN_{}",
method.item.name.0.to_uppercase()
)),
generics: None,
},
],
))]),
],
}),
},
))),
},
],
soft_return: None,
}))),
}),