Skip to content

Commit

Permalink
feat(lib): 🎸 Create a library crate
Browse files Browse the repository at this point in the history
BREAKING CHANGE: 🧨 RamMachine and other stuff cannot be accessed using crate:: in main (use
ram_machine:: instead)
  • Loading branch information
kamack38 committed Feb 7, 2024
1 parent cd60242 commit 315ed1f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
5 changes: 5 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ repository = "https://github.com/kamack38/ram-machine"
keywords = ["cli", "ram", "machine", "maszyna"]
categories = ["command-line-utilities"]

[lib]
name = "ram_machine"
path = "src/lib.rs"
doc = true

[[bin]]
name = "ram"
path = "src/main.rs"
Expand Down
2 changes: 1 addition & 1 deletion src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use std::path::PathBuf;
use std::{fs, io};
use thiserror::Error;

use crate::{
use ram_machine::{
interpreter::{RamMachine, RamMachineError},
parser::ParserError,
};
Expand Down
6 changes: 6 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
pub mod interpreter;
pub mod parser;

pub use parser::instruction;
pub use parser::operand;
pub use parser::ram_code;

0 comments on commit 315ed1f

Please sign in to comment.