1pub(crate) use std::fmt::Display;
2
3#[macro_export]
4macro_rules! impl_into_string { ($($t:ty), *) => { $(
5 impl Into<String> for $t { fn into(self) -> String { self.to_string() } }
6)* } }
7
8#[derive(Clone, Default)]
9pub struct File(Vec<String>);
10impl File {
11 pub fn save(&self, path: &str) -> std::io::Result<()> {
12 std::fs::write(path, self.to_string())
13 }
14}
15impl Display for File {
16 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
17 write!(f, "{}", self.0.iter().map(|d| format!("{d}\n")).collect::<String>())
18 }
19}
20impl_into_string!(File);
21
22#[cfg_attr(feature = "go", path = "go_asm/mod.rs")]
23pub mod go_asm;
24
25#[cfg_attr(feature = "py", path = "py_asm/mod.rs")]
26pub mod py_asm;