lang: remove this attempt

This commit is contained in:
Schrottkatze 2024-06-23 20:53:05 +02:00
parent 1c6180aabc
commit eb7806572b
Signed by: schrottkatze
SSH key fingerprint: SHA256:hXb3t1vINBFCiDCmhRABHX5ocdbLiKyCdKI4HK2Rbbc
19 changed files with 1 additions and 1885 deletions

View file

@ -1,55 +0,0 @@
use std::{
fmt::Display,
path::{Path, PathBuf},
sync::{Arc, Mutex},
};
use crate::world::world_creation_pool::WorldCreationPool;
use easy_parallel::Parallel;
use futures_lite::future;
use smol::{
channel::{unbounded, Sender},
Executor,
};
use self::{error::Error, files::Files, registry::Registry};
pub mod error;
pub mod files;
pub mod modules;
pub mod nodes;
pub mod registry;
mod world_creation_pool;
pub struct World {}
impl World {
pub fn new(entry_point: &Path) -> Result<Self, WorldCreationError> {
let files = Files::new();
let reg = Registry::new();
let (entry_point_id, errors) = files.add_and_parse(entry_point).map_err(|e| {
WorldCreationError::FailedToOpenEntryPoint(entry_point.to_path_buf(), e)
})?;
let pool = WorldCreationPool::new(files, reg);
todo!()
}
}
#[derive(Debug)]
pub enum WorldCreationError {
FailedToOpenEntryPoint(PathBuf, std::io::Error),
}
impl Display for WorldCreationError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
WorldCreationError::FailedToOpenEntryPoint(entry_path, e) => {
write!(f, "failed to open entry_point '{entry_path:?}': {e}")
}
}
}
}