Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test command line #1316

Merged
merged 17 commits into from
Jul 8, 2024
Prev Previous commit
Next Next commit
Fix
  • Loading branch information
raviqqe committed Jul 8, 2024
commit 0a692433f24afd14b21a97e7384d8422c3671f6f
10 changes: 6 additions & 4 deletions cmd/run/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,15 @@ fn main() -> Result<(), MainError> {
Library::R7rs => PRELUDE_SOURCE.into(),
};
let mut target = vec![];
let Some(index) = arguments
let index = arguments
.arguments
.iter()
.rposition(|argument| argument.ends_with(SCHEME_FILE_EXTENSION))
else {
.take_while(|argument| argument.ends_with(SCHEME_FILE_EXTENSION))
.count();

if index == 0 {
return Err("No scheme file specified".into());
};
}

read_source(&arguments.arguments[..index], &mut source)?;
compile(&source, &mut target, &mut heap)?;
Expand Down
Loading