diff options
Diffstat (limited to 'audio/src/data.rs')
| -rw-r--r-- | audio/src/data.rs | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/audio/src/data.rs b/audio/src/data.rs index e63254d..9ed8019 100644 --- a/audio/src/data.rs +++ b/audio/src/data.rs @@ -3,13 +3,17 @@ use std::fs; macro_rules! load_asm { ($path:tt) => {{ - if cfg!(any(feature = "static", target_arch = "wasm32")) { + let res = if cfg!(any(feature = "static", target_arch = "wasm32")) { let src = include_str!(concat!("../../", $path)); - Program::parse(src, true)? + Program::parse(src, true) } else { let src = fs::read_to_string($path)?; - Program::parse(&src, true)? - } + Program::parse(&src, true) + }; + res.map_err(|mut err| { + err.file = Some(String::from($path)); + err + })? }}; ($first:tt, $($arg:tt),*) => { load_asm!($first)$(.merge(load_asm!($arg)))* |