| 257 | } |
| 258 | |
| 259 | int das_program_simulate ( das_program * program, das_context * ctx, das_text_writer * tout ) { |
| 260 | auto prog = (Program *) program; |
| 261 | bool ok; |
| 262 | { |
| 263 | gc_guard simulate_gc_scope; |
| 264 | ok = prog->simulate(*((Context *)ctx), *((TextWriter *)tout)); |
| 265 | for ( auto mod : prog->library.getModules() ) { |
| 266 | if ( !mod->builtIn ) { |
| 267 | mod->gc_collect(&simulate_gc_scope.guard_root); |
| 268 | } |
| 269 | } |
| 270 | } |
| 271 | return ok ? 1 : 0; |
| 272 | } |
| 273 | |
| 274 | das_error * das_program_get_error ( das_program * program, int index ) { |
| 275 | auto prog = (Program *) program; |