use crate::Span;
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct RecGroup {
pub span: Span,
pub types: Vec<SubType>,
pub is_explicit: bool,
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct SubType {
pub is_final: bool,
pub supertype_idx: Option<u32>,
pub composite_type: CompositeType,
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct CompositeType {
pub inner: CompositeInnerType,
pub shared: bool,
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum CompositeInnerType {
Func(FuncType),
Array(ArrayType),
Struct(StructType),
Cont(ContType),
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct FuncType {
pub params: Vec<wasmparser::ValType>,
pub results: Vec<wasmparser::ValType>,
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct ArrayType {
pub field_type: FieldType,
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct StructType {
pub fields: Vec<FieldType>,
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct FieldType {
pub element_type: StorageType,
pub mutable: bool,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum StorageType {
I8,
I16,
Val(wasmparser::ValType),
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct ContType {
pub type_index: u32,
}