diff --git a/crates/codegen/src/lib.rs b/crates/codegen/src/lib.rs index 2a14d0e..b0d79de 100644 --- a/crates/codegen/src/lib.rs +++ b/crates/codegen/src/lib.rs @@ -176,11 +176,6 @@ impl GetRust for Identifier { impl GetRust for TypeExpr { fn get_rust(&self) -> String { match self { - // TypePostfix::Ref => format!("&"), - // TypePostfix::RefMut => format!("&mut "), - // TypePostfix::RefLifetime(lifetime) => format!("&'{} ", lifetime.get_rust()), - // TypePostfix::RefMutLifetime(lifetime) => format!("&'{} mut ", lifetime.get_rust()), - // TypePostfix::Dyn => format!("dyn "), Self::Path(path, generics) => { if let Some(generics) = generics { format!("{}{}", get_static_type_path(path), generics.get_rust()) @@ -197,6 +192,14 @@ impl GetRust for TypeExpr { .collect::>() .join(", ") ), + Self::StaticFn(types) => format!( + "fn({})", + types + .into_iter() + .map(|t| t.get_rust()) + .collect::>() + .join(", ") + ), Self::Ref { lifetime, diff --git a/crates/parser/src/ast/mod.rs b/crates/parser/src/ast/mod.rs index 6a975df..11014a3 100644 --- a/crates/parser/src/ast/mod.rs +++ b/crates/parser/src/ast/mod.rs @@ -26,6 +26,7 @@ pub enum TypeExpr { }, Dyn(Box), Path(Path, Option), + StaticFn(Vec), Tuple(Vec), Lifetime(Identifier), }