mirror of
https://github.com/voltrevo/ValueScript.git
synced 2026-04-18 03:00:27 -04:00
assembly -> asm
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
pub struct Assembly {
|
||||
pub struct Module {
|
||||
pub definitions: Vec<Definition>,
|
||||
}
|
||||
|
||||
impl std::fmt::Display for Assembly {
|
||||
impl std::fmt::Display for Module {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
|
||||
for definition in &self.definitions {
|
||||
write!(f, "{}\n", definition)?;
|
||||
@@ -1,11 +1,11 @@
|
||||
use std::collections::HashMap;
|
||||
|
||||
use crate::assembly_ast::{
|
||||
Array, Assembly, Class, Definition, DefinitionContent, DefinitionRef, Function, Instruction,
|
||||
InstructionOrLabel, Label, LabelRef, Object, Register, Value,
|
||||
use crate::asm::{
|
||||
Array, Class, Definition, DefinitionContent, DefinitionRef, Function, Instruction,
|
||||
InstructionOrLabel, Label, LabelRef, Module, Object, Register, Value,
|
||||
};
|
||||
|
||||
pub fn assemble(assembly: &Assembly) -> Vec<u8> {
|
||||
pub fn assemble(assembly: &Module) -> Vec<u8> {
|
||||
let mut assembler = Assembler {
|
||||
output: Vec::new(),
|
||||
fn_data: Default::default(),
|
||||
@@ -15,7 +15,7 @@ pub fn assemble(assembly: &Assembly) -> Vec<u8> {
|
||||
},
|
||||
};
|
||||
|
||||
assembler.assembly(assembly);
|
||||
assembler.module(assembly);
|
||||
|
||||
return assembler.output;
|
||||
}
|
||||
@@ -27,8 +27,8 @@ struct Assembler {
|
||||
}
|
||||
|
||||
impl Assembler {
|
||||
fn assembly(&mut self, assembly: &Assembly) {
|
||||
for definition in &assembly.definitions {
|
||||
fn module(&mut self, module: &Module) {
|
||||
for definition in &module.definitions {
|
||||
self.definition(definition);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
mod asm;
|
||||
mod assemble;
|
||||
mod assembler;
|
||||
mod assembly_ast;
|
||||
mod capture_finder;
|
||||
mod compile;
|
||||
mod diagnostic;
|
||||
|
||||
Reference in New Issue
Block a user