@@ -12,6 +12,7 @@ use cambridge_asm::{
1212} ;
1313use clap:: { ArgEnum , Parser , Subcommand } ;
1414use std:: ffi:: OsString ;
15+ use cambridge_asm:: exec:: Io ;
1516
1617#[ cfg( feature = "cambridge" ) ]
1718const INST_SET : InstSet = parse:: get_fn;
@@ -99,6 +100,8 @@ fn main() -> std::io::Result<()> {
99100 #[ cfg( not( debug_assertions) ) ]
100101 std:: panic:: set_hook ( Box :: new ( handle_panic) ) ;
101102
103+ let io = Io :: default ( ) ;
104+
102105 match cli. commands {
103106 Commands :: Run {
104107 path,
@@ -109,27 +112,27 @@ fn main() -> std::io::Result<()> {
109112 use InFormats :: * ;
110113
111114 let parser: Box < dyn FnOnce ( Vec < u8 > , InstSet ) -> Executor > = match format {
112- Pasm => Box :: new ( |v, set| parse:: parse ( String :: from_utf8_lossy ( & v) , set) ) ,
115+ Pasm => Box :: new ( |v, set| parse:: parse ( String :: from_utf8_lossy ( & v) , set, io ) ) ,
113116 Json => Box :: new ( |v, set| {
114117 serde_json:: from_str :: < CompiledProg > ( & String :: from_utf8_lossy ( & v) )
115118 . unwrap ( )
116- . to_executor ( set)
119+ . to_executor ( set, io )
117120 } ) ,
118121 Ron => Box :: new ( |v, set| {
119122 ron:: from_str :: < CompiledProg > ( & String :: from_utf8_lossy ( & v) )
120123 . unwrap ( )
121- . to_executor ( set)
124+ . to_executor ( set, io )
122125 } ) ,
123126 Yaml => Box :: new ( |v, set| {
124127 serde_yaml:: from_str :: < CompiledProg > ( & String :: from_utf8_lossy ( & v) )
125128 . unwrap ( )
126- . to_executor ( set)
129+ . to_executor ( set, io )
127130 } ) ,
128131 Bin => Box :: new ( |v, set| {
129132 bincode:: decode_from_slice :: < CompiledProg , _ > ( & v, bincode:: config:: standard ( ) )
130133 . unwrap ( )
131134 . 0
132- . to_executor ( set)
135+ . to_executor ( set, io )
133136 } ) ,
134137 } ;
135138
0 commit comments