Plan for redo
This commit is contained in:
@@ -120,54 +120,133 @@ pub fn class_decl(
|
|||||||
column: 1,
|
column: 1,
|
||||||
item: Expression::Statement(Box::new(Statement::Block(Block {
|
item: Expression::Statement(Box::new(Statement::Block(Block {
|
||||||
is_unsafe: true,
|
is_unsafe: true,
|
||||||
statements: vec![Spanned {
|
statements: vec![
|
||||||
line: 1,
|
Spanned {
|
||||||
column: 1,
|
line: 1,
|
||||||
item: Expression::Statement(Box::new(Statement::VarDecl(
|
column: 1,
|
||||||
VarDeclStmt {
|
item: Expression::Statement(Box::new(Statement::VarDecl(
|
||||||
decl: VarDecl {
|
VarDeclStmt {
|
||||||
name: Pattern::Path(
|
decl: VarDecl {
|
||||||
false,
|
name: Pattern::Path(
|
||||||
Path(vec![Identifier(String::from("func_ptr"))]),
|
false,
|
||||||
),
|
Path(vec![Identifier(String::from("func_ptr"))]),
|
||||||
type_: None,
|
),
|
||||||
|
type_: None,
|
||||||
|
},
|
||||||
|
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,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
))]),
|
||||||
|
],
|
||||||
|
}),
|
||||||
},
|
},
|
||||||
init: Some(Expression::Fix {
|
))),
|
||||||
initial: Box::new(Expression::Path(ExprPath(vec![
|
},
|
||||||
ExprPathSegment {
|
Spanned {
|
||||||
ident: Identifier(String::from("self")),
|
line: 1,
|
||||||
generics: None,
|
column: 1,
|
||||||
},
|
item: Expression::Statement(Box::new(Statement::VarDecl(
|
||||||
]))),
|
VarDeclStmt {
|
||||||
prefixes: vec![Prefix::Deref],
|
decl: VarDecl {
|
||||||
postfixes: vec![
|
name: Pattern::Path(
|
||||||
Postfix::FieldAccess(
|
false,
|
||||||
Identifier(String::from("_m_oop")),
|
Path(vec![Identifier(String::from("func"))]),
|
||||||
None,
|
|
||||||
),
|
),
|
||||||
Postfix::TupleFieldAccess(0, None),
|
type_: Some(TypeExpr::StaticFn(
|
||||||
Postfix::FieldAccess(
|
method
|
||||||
Identifier(String::from("add")),
|
.item
|
||||||
None,
|
.params
|
||||||
),
|
.0
|
||||||
Postfix::Call(vec![Expression::Path(ExprPath(vec![
|
.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 {
|
ExprPathSegment {
|
||||||
ident: Identifier(String::from("Self")),
|
ident: Identifier(String::from("self")),
|
||||||
generics: None,
|
generics: None,
|
||||||
},
|
},
|
||||||
ExprPathSegment {
|
]))),
|
||||||
ident: Identifier(format!(
|
prefixes: vec![Prefix::Deref],
|
||||||
"__FN_{}",
|
postfixes: vec![
|
||||||
method.item.name.0.to_uppercase()
|
Postfix::FieldAccess(
|
||||||
)),
|
Identifier(String::from("_m_oop")),
|
||||||
generics: None,
|
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,
|
soft_return: None,
|
||||||
}))),
|
}))),
|
||||||
}),
|
}),
|
||||||
|
|||||||
Reference in New Issue
Block a user