Croissant Runtime
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
crsn/crsn/src/asm/mod.rs

17 lines
465 B

use std::sync::Arc;
use crate::asm::instr::Op;
use crate::asm::instr::op::AsmModule;
use crate::runtime::program::Program;
pub mod data;
pub mod error;
pub mod instr;
pub mod parse;
pub mod patches;
/// Parse a program from string and assemble a low level instruction sequence from it.
pub fn assemble(source: &str, parsers: &[Box<dyn AsmModule>]) -> Result<Arc<Program>, error::Error> {
let ops = parse::parse(source, parsers)?;
Ok(Program::new(ops))
}