diff options
author | Ben Bridle <bridle.benjamin@gmail.com> | 2025-05-29 12:18:16 +1200 |
---|---|---|
committer | Ben Bridle <bridle.benjamin@gmail.com> | 2025-05-29 12:18:28 +1200 |
commit | ff99a5df4c5a3265d215afa4b937fbb95a55b96c (patch) | |
tree | eb299429a57233881c47eb86622498eba841f03e /src/formats/mod.rs | |
download | bedrock-asm-ff99a5df4c5a3265d215afa4b937fbb95a55b96c.zip |
Initial commit
Diffstat (limited to 'src/formats/mod.rs')
-rw-r--r-- | src/formats/mod.rs | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/formats/mod.rs b/src/formats/mod.rs new file mode 100644 index 0000000..79b1c51 --- /dev/null +++ b/src/formats/mod.rs @@ -0,0 +1,23 @@ +mod clang; +pub use clang::*; + +use crate::*; + + +#[derive(Clone, Copy, PartialEq)] +pub enum Format { + Raw, + Source, + Clang, +} + +impl Format { + pub fn from_str(string: &str) -> Self { + match string { + "raw" => Self::Raw, + "source" => Self::Source, + "c" => Self::Clang, + _ => fatal!("Unknown format '{string}', expected 'raw', 'c', or 'source'"), + } + } +} |