Fail on missing closing brackets

This commit is contained in:
Sebastian Lohff 2022-01-03 16:53:17 +01:00
parent fdd2fa7361
commit de0d20b8f1
1 changed files with 4 additions and 0 deletions

View File

@ -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; return ! borked;
} }