Update assembler infrastructure to be more modular

Assembler has more discrete passes now, but things are kind of bare on
the error message front. But, everything is working as it did
previously, so we can move on to more interesting things.

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This commit is contained in:
2020-03-03 18:10:08 -05:00
parent ad7c22c168
commit ef03ea9137
7 changed files with 426 additions and 321 deletions

View File

@@ -107,13 +107,11 @@ fn get_writer(path: impl AsRef<Path>) -> Result<Box<dyn Write>> {
fn main() -> Result<()> {
use vm::{
state::State,
obj::assemble::AsmSession,
obj::assemble,
};
let opt = Options::from_args();
let mut asm_session = AsmSession::default();
asm_session.include(&opt.input)?;
let object = asm_session.assemble()?;
let object = assemble::assemble_path(&opt.input)?;
if opt.compile_only {
let outfile = opt.out.clone().unwrap_or_else(|| {