fin du module de parsing
This commit is contained in:
20
src/parse.rs
20
src/parse.rs
@@ -11,19 +11,31 @@ fn find_operator(argument: String) -> Vec<String> {
|
|||||||
match character {
|
match character {
|
||||||
'+' => {
|
'+' => {
|
||||||
args_with_operator.push(string.clone());
|
args_with_operator.push(string.clone());
|
||||||
string.clear()
|
string.clear();
|
||||||
|
string.push('+'.into());
|
||||||
|
args_with_operator.push(string.clone());
|
||||||
|
string.clear();
|
||||||
}
|
}
|
||||||
'-' => {
|
'-' => {
|
||||||
args_with_operator.push(string.clone());
|
args_with_operator.push(string.clone());
|
||||||
string.clear()
|
string.clear();
|
||||||
|
string.push('-'.into());
|
||||||
|
args_with_operator.push(string.clone());
|
||||||
|
string.clear();
|
||||||
}
|
}
|
||||||
'*' => {
|
'*' => {
|
||||||
args_with_operator.push(string.clone());
|
args_with_operator.push(string.clone());
|
||||||
string.clear()
|
string.clear();
|
||||||
|
string.push('*'.into());
|
||||||
|
args_with_operator.push(string.clone());
|
||||||
|
string.clear();
|
||||||
}
|
}
|
||||||
'/' => {
|
'/' => {
|
||||||
args_with_operator.push(string.clone());
|
args_with_operator.push(string.clone());
|
||||||
string.clear()
|
string.clear();
|
||||||
|
string.push('/'.into());
|
||||||
|
args_with_operator.push(string.clone());
|
||||||
|
string.clear();
|
||||||
}
|
}
|
||||||
_ => string.push(character.into()),
|
_ => string.push(character.into()),
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user