parser : une simple quote non matchée attend une entrée de l'utilisateur
This commit is contained in:
parent
fb09cfc8c6
commit
c1171aa0b2
1 changed files with 8 additions and 1 deletions
|
@ -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();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue