Added directfs

Added a very rudimentary file I/O system suitable for experimenting
with the language further. A better one will be designed when we have
sensible error management.
This commit is contained in:
2023-09-17 16:37:39 +01:00
parent 1078835e8b
commit 7396078304
84 changed files with 563 additions and 721 deletions

View File

@@ -21,6 +21,7 @@ pub struct HandlerTable<'a> {
}
impl<'a> HandlerTable<'a> {
/// Create a new [HandlerTable]
#[must_use]
pub fn new() -> Self { Self { handlers: HashMap::new() } }
/// Add a handler function to interpret a type of atom and decide what happens
@@ -46,6 +47,7 @@ impl<'a> HandlerTable<'a> {
}
/// Combine two non-overlapping handler sets
#[must_use]
pub fn combine(mut self, other: Self) -> Self {
for (key, value) in other.handlers {
let prev = self.handlers.insert(key, value);