pub mod parser;
use std::collections::{HashMap, HashSet};
use crate::Spanned;
#[derive(Debug, Clone, PartialEq)]
pub struct EnumDef {
pub name: String,
pub variants: HashSet<String>,
}
#[derive(Debug, Clone, PartialEq)]
pub enum SchemaType {
String,
Integer,
Float,
Bool,
Option(Box<SchemaType>),
List(Box<SchemaType>),
EnumRef(String),
Struct(StructDef),
}
#[derive(Debug, Clone, PartialEq)]
pub struct FieldDef {
pub name: Spanned<String>,
pub type_: Spanned<SchemaType>,
}
#[derive(Debug, Clone, PartialEq)]
pub struct StructDef {
pub fields: Vec<FieldDef>,
}
#[derive(Debug, Clone, PartialEq)]
pub struct Schema {
pub root: StructDef,
pub enums: HashMap<String, EnumDef>,
}