summaryrefslogtreecommitdiff
path: root/src/bin/br/formats/mod.rs
diff options
context:
space:
mode:
authorBen Bridle <ben@derelict.engineering>2025-03-25 12:46:49 +1300
committerBen Bridle <ben@derelict.engineering>2025-03-25 12:48:49 +1300
commitab84ad75629b0a4124221023ca91411d2cd62a32 (patch)
tree0c333f06bec5270084aaec71cf173c798420207b /src/bin/br/formats/mod.rs
parent07ae3438917fd854a46924a410f6890cd0651f1b (diff)
downloadbedrock-pc-ab84ad75629b0a4124221023ca91411d2cd62a32.zip
Restructure program
This commit also includes changes to devices according to the latest devices specification, in particular the math and system devices.
Diffstat (limited to 'src/bin/br/formats/mod.rs')
-rw-r--r--src/bin/br/formats/mod.rs24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/bin/br/formats/mod.rs b/src/bin/br/formats/mod.rs
new file mode 100644
index 0000000..b159b16
--- /dev/null
+++ b/src/bin/br/formats/mod.rs
@@ -0,0 +1,24 @@
+mod clang;
+
+pub use clang::*;
+
+use log::fatal;
+
+
+#[derive(Clone, Copy, PartialEq)]
+pub enum Format {
+ Binary,
+ Source,
+ Clang,
+}
+
+impl Format {
+ pub fn from_str(string: &str) -> Self {
+ match string {
+ "binary" => Self::Binary,
+ "source" => Self::Source,
+ "c" => Self::Clang,
+ _ => fatal!("Unknown format '{string}', expected 'binary', 'c', or 'source'"),
+ }
+ }
+}