mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-03-16 02:00:51 +00:00
Implement quote::ToTokens for AST types
They were already implemented, just without the formalization ;)
This commit is contained in:
parent
4c4d8dab26
commit
c2e9a4b71e
@ -10,7 +10,7 @@ pub struct Program {
|
||||
pub exports: Vec<Export>,
|
||||
pub imports: Vec<Import>,
|
||||
pub enums: Vec<Enum>,
|
||||
pub imported_types: Vec<(syn::Visibility, syn::Ident)>,
|
||||
pub imported_types: Vec<ImportedType>,
|
||||
pub structs: Vec<Struct>,
|
||||
}
|
||||
|
||||
@ -53,6 +53,11 @@ pub struct Enum {
|
||||
pub variants: Vec<(syn::Ident, u32)>
|
||||
}
|
||||
|
||||
pub struct ImportedType {
|
||||
pub vis: syn::Visibility,
|
||||
pub name: syn::Ident,
|
||||
}
|
||||
|
||||
pub enum Type {
|
||||
// special
|
||||
Vector(VectorType, bool),
|
||||
@ -323,7 +328,10 @@ impl Program {
|
||||
pub fn push_foreign_ty(&mut self,
|
||||
f: syn::ForeignItemType,
|
||||
_module_opts: &BindgenAttrs) {
|
||||
self.imported_types.push((f.vis, f.ident));
|
||||
self.imported_types.push(ImportedType {
|
||||
vis: f.vis,
|
||||
name: f.ident
|
||||
});
|
||||
}
|
||||
|
||||
pub fn wbg_literal(&self, dst: &mut Tokens) -> usize {
|
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user