Plan for redo
This commit is contained in:
@@ -120,7 +120,8 @@ 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![
|
||||||
|
Spanned {
|
||||||
line: 1,
|
line: 1,
|
||||||
column: 1,
|
column: 1,
|
||||||
item: Expression::Statement(Box::new(Statement::VarDecl(
|
item: Expression::Statement(Box::new(Statement::VarDecl(
|
||||||
@@ -150,7 +151,8 @@ pub fn class_decl(
|
|||||||
Identifier(String::from("add")),
|
Identifier(String::from("add")),
|
||||||
None,
|
None,
|
||||||
),
|
),
|
||||||
Postfix::Call(vec![Expression::Path(ExprPath(vec![
|
Postfix::Call(vec![Expression::Path(ExprPath(
|
||||||
|
vec![
|
||||||
ExprPathSegment {
|
ExprPathSegment {
|
||||||
ident: Identifier(String::from("Self")),
|
ident: Identifier(String::from("Self")),
|
||||||
generics: None,
|
generics: None,
|
||||||
@@ -162,12 +164,89 @@ pub fn class_decl(
|
|||||||
)),
|
)),
|
||||||
generics: None,
|
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,
|
soft_return: None,
|
||||||
}))),
|
}))),
|
||||||
}),
|
}),
|
||||||
|
|||||||
Reference in New Issue
Block a user