use crate::{errors::RunError, stack::Instruction}; pub fn insert(program: &mut Vec, arg: &String, data: &u16) { let args: Vec = arg.chars().collect(); if args[0] == '#' || args[0] == '$' { eprintln!("{}", RunError::AttemptToInsertHashOrStringInst); std::process::exit(2); } if args[0] == '\n' { eprintln!("{}", RunError::AttemptToInsertEmptyConst); std::process::exit(2); } if args[0] == '@' || args[1] == ' ' { eprintln!("{}", RunError::AttemptToInsertALabel); std::process::exit(2); } program.push(Instruction { name: arg.to_string(), arg: "\n".to_string(), data: *data }); }