2022-01-23 20:04:19 +00:00
|
|
|
use super::types::Type;
|
|
|
|
|
2022-02-15 20:32:55 +00:00
|
|
|
pub struct Callable {
|
2022-01-23 20:04:19 +00:00
|
|
|
pub name: String,
|
2022-02-15 20:32:55 +00:00
|
|
|
pub args: Vec<(Option<String>, Type)>,
|
|
|
|
pub ret_type: Option<Type>,
|
2022-01-23 20:04:19 +00:00
|
|
|
}
|
|
|
|
|
2022-02-15 20:32:55 +00:00
|
|
|
impl<'ty> Callable {
|
2022-01-23 20:04:19 +00:00
|
|
|
pub fn name(&self) -> &str {
|
|
|
|
&self.name
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn argcount(&self) -> usize {
|
|
|
|
self.args.len()
|
|
|
|
}
|
|
|
|
}
|