mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-03-31 17:31:06 +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 exports: Vec<Export>,
|
||||||
pub imports: Vec<Import>,
|
pub imports: Vec<Import>,
|
||||||
pub enums: Vec<Enum>,
|
pub enums: Vec<Enum>,
|
||||||
pub imported_types: Vec<(syn::Visibility, syn::Ident)>,
|
pub imported_types: Vec<ImportedType>,
|
||||||
pub structs: Vec<Struct>,
|
pub structs: Vec<Struct>,
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -53,6 +53,11 @@ pub struct Enum {
|
|||||||
pub variants: Vec<(syn::Ident, u32)>
|
pub variants: Vec<(syn::Ident, u32)>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub struct ImportedType {
|
||||||
|
pub vis: syn::Visibility,
|
||||||
|
pub name: syn::Ident,
|
||||||
|
}
|
||||||
|
|
||||||
pub enum Type {
|
pub enum Type {
|
||||||
// special
|
// special
|
||||||
Vector(VectorType, bool),
|
Vector(VectorType, bool),
|
||||||
@ -323,7 +328,10 @@ impl Program {
|
|||||||
pub fn push_foreign_ty(&mut self,
|
pub fn push_foreign_ty(&mut self,
|
||||||
f: syn::ForeignItemType,
|
f: syn::ForeignItemType,
|
||||||
_module_opts: &BindgenAttrs) {
|
_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 {
|
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