mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-06-28 20:21:35 +00:00
Start adding support for classes
This commit is contained in:
@ -1,6 +1,26 @@
|
||||
#[macro_use]
|
||||
extern crate serde_derive;
|
||||
|
||||
#[derive(Serialize, Deserialize)]
|
||||
pub struct Program {
|
||||
pub structs: Vec<Struct>,
|
||||
pub free_functions: Vec<Function>,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize)]
|
||||
pub struct Struct {
|
||||
pub name: String,
|
||||
pub ctor: Function,
|
||||
pub functions: Vec<Function>,
|
||||
pub methods: Vec<Method>,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize)]
|
||||
pub struct Method {
|
||||
pub mutable: bool,
|
||||
pub function: Function,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize)]
|
||||
pub struct Function {
|
||||
pub name: String,
|
||||
@ -13,6 +33,9 @@ pub enum Type {
|
||||
Number,
|
||||
BorrowedStr,
|
||||
String,
|
||||
ByValue(String),
|
||||
ByRef(String),
|
||||
ByMutRef(String),
|
||||
}
|
||||
|
||||
impl Type {
|
||||
|
Reference in New Issue
Block a user