Fail on missing closing brackets

main
Sebastian Lohff 11 months ago
parent fdd2fa7361
commit de0d20b8f1
  1. 4
      src/main.rs

@ -28,6 +28,10 @@ fn check_brainfuck(prog: &str) -> bool {
},
}
}
if brackets > 0 {
println!("Not all brackets have been closed, {} remain open", brackets);
borked = true;
}
return ! borked;
}

Loading…
Cancel
Save