mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-06-12 04:21:21 +00:00
Backend refactor (#411)
* remove BindgenAttrs from other backend::ast structs This is primarily a tool for use with the macro crate. Most of these attributes were ignored in the actual codegen, but a few were still being used. This is confusing when trying to add other sources for codegen (such as webidl and typescript). * move parsing logic to macro crate This makes the backend crate solely concerned with having an ast for which we can generate code.
This commit is contained in:
committed by
Alex Crichton
parent
056b45aeed
commit
2d50d5209b
@ -1,7 +1,7 @@
|
||||
#[macro_use]
|
||||
extern crate serde_derive;
|
||||
|
||||
pub const SCHEMA_VERSION: &str = "5";
|
||||
pub const SCHEMA_VERSION: &str = "6";
|
||||
|
||||
#[derive(Deserialize)]
|
||||
pub struct ProgramOnlySchema {
|
||||
@ -48,15 +48,25 @@ pub struct ImportFunction {
|
||||
pub struct MethodData {
|
||||
pub class: String,
|
||||
pub kind: MethodKind,
|
||||
pub getter: Option<String>,
|
||||
pub setter: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Serialize)]
|
||||
pub enum MethodKind {
|
||||
Normal,
|
||||
Constructor,
|
||||
Static,
|
||||
Operation(Operation),
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Serialize)]
|
||||
pub struct Operation {
|
||||
pub is_static: bool,
|
||||
pub kind: OperationKind,
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Serialize)]
|
||||
pub enum OperationKind {
|
||||
Regular,
|
||||
Getter(String),
|
||||
Setter(String),
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Serialize)]
|
||||
|
Reference in New Issue
Block a user