Splitting vasm and vasm_core
This commit is contained in:
Generated
+2
@@ -8,6 +8,8 @@
|
||||
<sourceFolder url="file://$MODULE_DIR$/vtest/src" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/vlua/src" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/vasm_core/src" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/vasm/src" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/vweb/src" isTestSource="false" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/target" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
|
||||
Generated
+20
-2
@@ -412,8 +412,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9be70c98951c83b8d2f8f60d7065fa6d5146873094452a1008da8c2f1e4205ad"
|
||||
dependencies = [
|
||||
"cfg-if 1.0.0",
|
||||
"js-sys",
|
||||
"libc",
|
||||
"wasi 0.10.2+wasi-snapshot-preview1",
|
||||
"wasm-bindgen",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -1254,6 +1256,13 @@ checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3"
|
||||
[[package]]
|
||||
name = "vasm"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"vasm_core",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "vasm_core"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"pest",
|
||||
"pest_derive",
|
||||
@@ -1264,6 +1273,7 @@ dependencies = [
|
||||
name = "vcore"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"getrandom",
|
||||
"rand",
|
||||
]
|
||||
|
||||
@@ -1273,7 +1283,7 @@ version = "0.1.0"
|
||||
dependencies = [
|
||||
"pixels",
|
||||
"rand",
|
||||
"vasm",
|
||||
"vasm_core",
|
||||
"vcore",
|
||||
"winit",
|
||||
]
|
||||
@@ -1296,10 +1306,18 @@ dependencies = [
|
||||
name = "vtest"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"vasm",
|
||||
"vasm_core",
|
||||
"vcore",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "vweb"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"vcore",
|
||||
"wasm-bindgen",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "wasi"
|
||||
version = "0.10.2+wasi-snapshot-preview1"
|
||||
|
||||
+3
-1
@@ -4,6 +4,8 @@ members = [
|
||||
"vcore",
|
||||
"vemu",
|
||||
"vasm_core",
|
||||
"vasm",
|
||||
"vtest",
|
||||
"vlua"
|
||||
"vlua",
|
||||
"vweb"
|
||||
]
|
||||
@@ -0,0 +1,9 @@
|
||||
[package]
|
||||
name = "vasm"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
vasm_core = { path = "../vasm_core" }
|
||||
@@ -0,0 +1,3 @@
|
||||
fn main() {
|
||||
println!("Hello, world!");
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
[package]
|
||||
name = "vasm"
|
||||
name = "vasm_core"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
use std::collections::btree_map::BTreeMap;
|
||||
use crate::ast::{Label, Scope, VASMLine};
|
||||
use crate::parse_error::{AssembleError, Location};
|
||||
use crate::vasm_evaluator::eval;
|
||||
use crate::vasm_preprocessor::{Line, LineSource};
|
||||
use std::collections::BTreeMap;
|
||||
use std::fs;
|
||||
|
||||
/// This will solve all the .equ directives and return a symbol table of them.
|
||||
@@ -163,7 +163,7 @@ fn code_bounds(
|
||||
/// bytes long and index 0 will represent 0x400.
|
||||
/// ```
|
||||
/// assert_eq!(
|
||||
/// vasm::assemble_snippet(".org 0x400 \n push 5 \n add 7".lines().map(String::from)),
|
||||
/// vasm_core::assemble_snippet(".org 0x400 \n push 5 \n add 7".lines().map(String::from)),
|
||||
/// Ok(vec![0x01, 0x05, 0x05, 0x07])
|
||||
/// )
|
||||
/// ```
|
||||
@@ -186,7 +186,6 @@ pub fn assemble_snippet<T: IntoIterator<Item = String>>(
|
||||
pub fn assemble_file(filename: &str) -> Result<Vec<u8>, AssembleError> {
|
||||
let lines = lines_from_file(filename)?;
|
||||
let line_results: Vec<Result<Line, AssembleError>> = LineSource::new(filename, lines, |file| {
|
||||
println!("Including {}", file);
|
||||
lines_from_file(file.as_str())
|
||||
})
|
||||
.collect();
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
use std::collections::vec_deque::VecDeque;
|
||||
use crate::ast::{Macro, VASMLine};
|
||||
use crate::parse_error::{AssembleError, Location};
|
||||
use crate::vasm_parser::parse_vasm_line;
|
||||
use std::collections::VecDeque;
|
||||
use std::iter::Enumerate;
|
||||
|
||||
#[derive(Debug, PartialEq, Clone)]
|
||||
|
||||
@@ -6,4 +6,5 @@ edition = "2021"
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
getrandom = { version = "0.2", features = ["js"] }
|
||||
rand = "0.8.0"
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
vcore = { path = "../vcore" }
|
||||
vasm = { path = "../vasm_core" }
|
||||
vasm_core = { path = "../vasm_core" }
|
||||
rand = "0.8.0"
|
||||
winit = "0.26.1"
|
||||
pixels = "0.9.0"
|
||||
+1
-1
@@ -14,7 +14,7 @@ use std::collections::VecDeque;
|
||||
use std::fs::File;
|
||||
use std::io::Read;
|
||||
use std::time::{Duration, Instant};
|
||||
use vasm::{assemble_file, assemble_snippet};
|
||||
use vasm_core::{assemble_file, assemble_snippet};
|
||||
use vcore::cpu::CPU;
|
||||
use vcore::memory::{Memory, PeekPoke};
|
||||
use vcore::word::Word;
|
||||
|
||||
+1
-1
@@ -7,4 +7,4 @@ edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
vcore = { path = "../vcore" }
|
||||
vasm = { path = "../vasm_core" }
|
||||
vasm_core = { path = "../vasm_core" }
|
||||
@@ -1,5 +1,5 @@
|
||||
use std::collections::BTreeMap;
|
||||
use vasm::assemble_snippet;
|
||||
use std::collections::btree_map::BTreeMap;
|
||||
use vasm_core::assemble_snippet;
|
||||
use vcore::memory::{Memory, PeekPokeExt};
|
||||
use vcore::word::Word;
|
||||
use vcore::CPU;
|
||||
|
||||
Reference in New Issue
Block a user