tuple codegen
This commit is contained in:
@@ -14,6 +14,7 @@ pub struct Block(pub Vec<Statement>);
|
|||||||
#[derive(Debug, Clone, Serialize)]
|
#[derive(Debug, Clone, Serialize)]
|
||||||
pub enum TypeExpr {
|
pub enum TypeExpr {
|
||||||
Path(StaticPath),
|
Path(StaticPath),
|
||||||
|
Tuple(Vec<TypeExpr>),
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, Serialize)]
|
#[derive(Debug, Clone, Serialize)]
|
||||||
|
|||||||
@@ -76,6 +76,14 @@ impl GetRust for TypeExpr {
|
|||||||
fn get_rust(&self) -> String {
|
fn get_rust(&self) -> String {
|
||||||
match self {
|
match self {
|
||||||
TypeExpr::Path(path) => get_static_type_path(path),
|
TypeExpr::Path(path) => get_static_type_path(path),
|
||||||
|
TypeExpr::Tuple(types) => format!(
|
||||||
|
"({})",
|
||||||
|
types
|
||||||
|
.iter()
|
||||||
|
.map(|t| t.get_rust())
|
||||||
|
.collect::<Vec<_>>()
|
||||||
|
.join(", ")
|
||||||
|
),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user