Generate enum js code

This commit is contained in:
Ryan Levick
2018-02-22 12:01:38 +01:00
parent 45543c545e
commit f11121b095
3 changed files with 55 additions and 7 deletions

View File

@ -8,6 +8,7 @@ use std::hash::{Hash, Hasher};
#[derive(Deserialize)]
pub struct Program {
pub exports: Vec<Export>,
pub enums: Vec<Enum>,
pub imports: Vec<Import>,
pub custom_type_names: Vec<CustomTypeName>,
}
@ -32,6 +33,17 @@ pub struct Export {
pub function: Function,
}
#[derive(Deserialize)]
pub struct Enum {
pub name: String,
pub variants: Vec<EnumVariant>,
}
#[derive(Deserialize)]
pub struct EnumVariant {
pub name: String
}
#[derive(Deserialize)]
pub struct Function {
pub name: String,