Introduce type aliases in syntax tree
diff --git a/syntax/mod.rs b/syntax/mod.rs
index fd8db73..3eb6c6e 100644
--- a/syntax/mod.rs
+++ b/syntax/mod.rs
@@ -20,7 +20,7 @@
use proc_macro2::{Ident, Span};
use syn::punctuated::Punctuated;
use syn::token::{Brace, Bracket, Paren};
-use syn::{Lifetime, LitStr, Token};
+use syn::{Lifetime, LitStr, Token, Type as RustType};
pub use self::atom::Atom;
pub use self::doc::Doc;
@@ -35,6 +35,7 @@
CxxFunction(ExternFn),
RustType(ExternType),
RustFunction(ExternFn),
+ TypeAlias(TypeAlias),
}
pub struct ExternType {
@@ -68,6 +69,14 @@
pub semi_token: Token![;],
}
+pub struct TypeAlias {
+ pub type_token: Token![type],
+ pub ident: Ident,
+ pub eq_token: Token![=],
+ pub ty: RustType,
+ pub semi_token: Token![;],
+}
+
pub struct Signature {
pub fn_token: Token![fn],
pub receiver: Option<Receiver>,