added a create-project system to assembler, and fixed a couple of parsing bugs

This commit is contained in:
2025-06-20 03:25:28 +01:00
parent f791b05292
commit 42c26d4184
15 changed files with 392 additions and 107 deletions
+4 -2
View File
@@ -11,6 +11,8 @@ use crate::emulator::{
ui::interface::Component,
};
use assembler::prelude::*;
pub struct Editor {
// editor state
path: Option<PathBuf>,
@@ -344,10 +346,10 @@ impl Editor {
// builds the current file
if ui.button("Build").clicked() && !self.unsaved {
if let Some(path) = &self.path {
let instructions = match assembler::assemble(path) {
let instructions = match assemble(path) {
Ok(instructions) => instructions,
Err(error) => {
self.error = Some(error.to_string());
self.error = Some(format!("Failed to assemble: {error:?}"));
return;
}
};