Skip to content

Commit

Permalink
refactor(vm, frontend): internally tag template enum, finish remap fr…
Browse files Browse the repository at this point in the history
…ontend
  • Loading branch information
Ryex committed Jun 1, 2024
1 parent 337ca50 commit d618f7b
Show file tree
Hide file tree
Showing 20 changed files with 3,055 additions and 447 deletions.
176 changes: 0 additions & 176 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 0 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,3 @@ opt-level = "s"
lto = true
[profile.dev]
opt-level = 1


[patch.crates-io]
onig_sys = { git = "https://github.com/rust-onig/rust-onig", revision = "fa90c0e97e90a056af89f183b23cd417b59ee6a2" }
5 changes: 3 additions & 2 deletions ic10emu/src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use crate::vm::{
},
};
use serde_derive::{Deserialize, Serialize};
use stationeers_data::templates::ObjectTemplate;
use std::error::Error as StdError;
use std::fmt::Display;
use thiserror::Error;
Expand Down Expand Up @@ -77,8 +78,8 @@ pub enum TemplateError {
NoTemplateForPrefab(Prefab),
#[error("no prefab provided")]
MissingPrefab,
#[error("incorrect template for concreet impl {0} from prefab {1}")]
IncorrectTemplate(String, Prefab),
#[error("incorrect template for concrete impl {0} from prefab {1}: {2:?}")]
IncorrectTemplate(String, Prefab, ObjectTemplate),
#[error("frozen memory size error: {0} is not {1}")]
MemorySize(usize, usize)

Expand Down
2 changes: 1 addition & 1 deletion ic10emu/src/interpreter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ pub struct ICInfo {
pub defines: BTreeMap<String, f64>,
pub labels: BTreeMap<String, u32>,
pub state: ICState,
pub yield_instruciton_count: u16,
pub yield_instruction_count: u16,
}

impl Display for ICState {
Expand Down
3 changes: 2 additions & 1 deletion ic10emu/src/vm/object/stationpedia.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ pub fn object_from_frozen(
return Err(TemplateError::IncorrectTemplate(
"ItemIntegratedCircuit10".to_string(),
Prefab::Name("ItemIntegratedCircuit10".to_string()),
template,
));
};

Expand Down Expand Up @@ -101,7 +102,7 @@ pub fn object_from_frozen(
ic: obj
.circuit
.as_ref()
.map(|circuit| circuit.yield_instruciton_count)
.map(|circuit| circuit.yield_instruction_count)
.unwrap_or(0),
aliases: obj
.circuit
Expand Down
Loading

0 comments on commit d618f7b

Please sign in to comment.