implem __str__ and __repr__ for call site
This commit is contained in:
parent
0c928e4fd2
commit
c937154601
1 changed files with 26 additions and 2 deletions
|
|
@ -1238,11 +1238,35 @@ impl CallSite {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn __str__(&self) -> String {
|
pub fn __str__(&self) -> String {
|
||||||
todo!()
|
let args = self
|
||||||
|
.args
|
||||||
|
.iter()
|
||||||
|
.map(|arg| arg.__str__())
|
||||||
|
.collect::<Vec<_>>()
|
||||||
|
.join(", ");
|
||||||
|
format!(
|
||||||
|
"call({} {} {} ({})",
|
||||||
|
self.method_handle.__str__(),
|
||||||
|
self.type_.__str__(),
|
||||||
|
self.name.__str__(),
|
||||||
|
args
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn __repr__(&self) -> String {
|
pub fn __repr__(&self) -> String {
|
||||||
todo!()
|
let args = self
|
||||||
|
.args
|
||||||
|
.iter()
|
||||||
|
.map(|arg| arg.__str__())
|
||||||
|
.collect::<Vec<_>>()
|
||||||
|
.join(", ");
|
||||||
|
format!(
|
||||||
|
"CallSite({}, {}, {}, [{}]",
|
||||||
|
self.method_handle.__repr__(),
|
||||||
|
self.type_.__repr__(),
|
||||||
|
self.name.__repr__(),
|
||||||
|
args
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue