Compile each stdlib module independently and return (name, object) pairs. No source concatenation: each HLL file becomes its own object.
(mode: TargetMode)
| 436 | |
| 437 | while live.steps < max_steps && matches!(live.state, MachineState::Running) { |
| 438 | let remaining = max_steps - live.steps; |
| 439 | live.drive( |
| 440 | remaining.min(config.run.max_steps_per_frame.max(1)), |
| 441 | Duration::from_secs(1), |
| 442 | ); |
| 443 | } |
| 444 | |
| 445 | print!("{}", live.uart_log); |
| 446 | match live.state { |
| 447 | MachineState::Exited(code) => { |
| 448 | eprintln!("fsc: kernel exited with code {code}"); |
| 449 | Ok(ExitCode::from((code & 0xFF) as u8)) |
| 450 | } |
| 451 | MachineState::Faulted(msg) => Err(CliError::Assemble(format!("kernel faulted: {msg}"))), |
| 452 | MachineState::Stopped | MachineState::Paused => Ok(ExitCode::SUCCESS), |
| 453 | MachineState::Running => Err(CliError::Timeout(max_steps)), |
| 454 | } |
| 455 | } |
| 456 | |
| 457 | fn config_for_cli_input(input: &str, mode: TargetMode) -> Result<(NativeFs, RunConfig), CliError> { |
| 458 | let (fs, path) = cli_workspace_for_input(input)?; |
| 459 | let config = if has_extension(input, "build") { |
| 460 | run_config_from_manifest(&fs, path).map_err(CliError::Io)? |
| 461 | } else { |