use indexmap::{
map::{Entry, Values},
IndexMap,
};
use nyar_error::{NyarError, Result};
use nyar_wasm::Identifier;
use std::{
fmt::{Debug, Formatter},
ops::AddAssign,
};
use valkyrie_ast::{helper::WrapDisplay, ClassDeclaration, ClassTerm, IdentifierNode, NamePathNode};
mod parser;
#[derive(Clone, Eq, PartialEq)]
pub struct ValkyrieStructure {
pub(crate) symbol: Identifier,
pub(crate) fields: IndexMap<String, ValkyrieField>,
pub(crate) methods: IndexMap<String, ValkyrieMethod>,
}
#[derive(Debug, Clone, Eq, PartialEq)]
pub struct ValkyrieField {}
#[derive(Debug, Clone, Eq, PartialEq)]
pub struct ValkyrieMethod {}
impl Debug for ValkyrieStructure {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
f.debug_struct("Structure")
.field("symbol", &WrapDisplay::new(&self.symbol))
.field("fields", &self.fields.values())
.finish()
}
}
impl AddAssign<ValkyrieField> for ValkyrieStructure {
fn add_assign(&mut self, rhs: ValkyrieField) {
}
}
impl ValkyrieStructure {
pub fn new(space: &NamePathNode, name: &IdentifierNode) -> Self {
todo!()
}
pub fn name(&self) -> String {
self.symbol.to_string()
}
}