parser : guarde contre un unwrap interdit dans parse_quote
This commit is contained in:
parent
cf1d6ff998
commit
ed6aa02ce4
1 changed files with 7 additions and 4 deletions
|
@ -3,11 +3,14 @@ use crate::command::command_sequence::CommandSequence;
|
||||||
|
|
||||||
fn parse_quote(characters: &mut Vec<char>) -> String {
|
fn parse_quote(characters: &mut Vec<char>) -> String {
|
||||||
let mut quoted = String::default();
|
let mut quoted = String::default();
|
||||||
let mut current_char = characters.pop().unwrap();
|
|
||||||
|
|
||||||
while !characters.is_empty() && current_char != '\'' {
|
if !characters.is_empty() {
|
||||||
quoted.push(current_char);
|
let mut current_char = characters.pop().unwrap();
|
||||||
current_char = characters.pop().unwrap();
|
|
||||||
|
while !characters.is_empty() && current_char != '\'' {
|
||||||
|
quoted.push(current_char);
|
||||||
|
current_char = characters.pop().unwrap();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
quoted
|
quoted
|
||||||
|
|
Loading…
Reference in a new issue