Skip to main content

hexicon_vm/
lib.rs

1//! The Hexicon virtual machine.
2//!
3//! This crate runs the games Hexicon builds (`.hxg` files). Their layout
4//! and instruction set are the T3 VM's, and it follows the T3 VM
5//! specification, and where that is silent, the behavior of the
6//! reference interpreter.
7//!
8//! The VM does no input or output of its own. Everything it needs from
9//! the outside world comes through a [`hexicon_host::Host`].
10
11/// Mark the rest of the block as work of a kind, for the profiler.
12#[cfg(feature = "profile")]
13macro_rules! prof_scope {
14    ($tag:expr) => {
15        let _prof_guard = crate::prof::scope($tag);
16    };
17}
18/// Nothing, without the profiler.
19#[cfg(not(feature = "profile"))]
20macro_rules! prof_scope {
21    ($tag:expr) => {};
22}
23
24mod bif;
25mod pane;
26pub(crate) use hexicon_decimal as decimal;
27mod bytearray;
28mod call;
29mod casefold;
30mod charset;
31mod chartype;
32mod compiled_code;
33mod console;
34mod date;
35mod decimal_math;
36mod decimal_obj;
37mod dict;
38mod error;
39mod file;
40mod frameref;
41mod gc;
42mod gram;
43mod hash;
44mod heap;
45pub mod identity;
46mod interp;
47mod io;
48mod list;
49mod load;
50mod map;
51mod meta;
52mod methods;
53mod object;
54mod ops;
55mod pack;
56#[cfg(feature = "profile")]
57pub mod prof;
58mod program_object;
59mod props;
60mod rebuild;
61mod reflect;
62mod regex;
63mod rng;
64mod save;
65mod specials;
66mod sprintf;
67mod strcomp;
68mod string;
69mod string_builder;
70mod trace;
71mod tz;
72mod value;
73mod vector;
74mod vm;
75
76pub use charset::decode_text;
77pub use error::{ErrParam, RuntimeError, VmError, VmResult, code};
78pub use rebuild::RebuiltImage;
79pub use value::{ObjId, PropId, Value};
80pub use vm::{RunState, Vm};
81
82#[cfg(test)]
83mod tests;