parser : une simple quote non matchée attend une entrée de l'utilisateur

This commit is contained in:
Ahurac 2024-04-19 12:17:10 +02:00
parent fb09cfc8c6
commit c1171aa0b2

View file

@ -30,8 +30,15 @@ fn parse_quote(characters: &mut VecDeque<char>) -> String {
if !characters.is_empty() { if !characters.is_empty() {
let mut current_char = characters.pop_front().unwrap(); let mut current_char = characters.pop_front().unwrap();
while !characters.is_empty() && current_char != '\'' { while current_char != '\'' {
quoted.push(current_char); quoted.push(current_char);
if characters.is_empty() {
let mut new_characters: VecDeque<char> =
get_user_input("> ").unwrap().chars().collect();
characters.append(&mut new_characters);
}
current_char = characters.pop_front().unwrap(); current_char = characters.pop_front().unwrap();
} }
} }