debut de parsing
This commit is contained in:
20
src/parse.rs
20
src/parse.rs
@@ -1,4 +1,20 @@
|
|||||||
// recupere les arguments passes en entree de l'appel du programme et les place dans un vecteurs de chaine
|
// recupere les arguments passes en entree de l'appel du programme et les place dans un vecteurs de chaine
|
||||||
pub fn arguments(){
|
pub fn arguments(args_to_process: Vec<String>) {
|
||||||
|
// trouver les operateurs et separer les membres de l'expression
|
||||||
|
for argument in args_to_process {}
|
||||||
|
}
|
||||||
|
|
||||||
|
fn find_operator(argument: String) -> Vec<String> {
|
||||||
|
let mut args_with_operator = Vec::new();
|
||||||
|
let string = Vec::new();
|
||||||
|
for character in argument {
|
||||||
|
match character {
|
||||||
|
"+" => args_with_operator.push(string.to_string()),
|
||||||
|
"-" => args_with_operator.push(string.to_string()),
|
||||||
|
"*" => args_with_operator.push(string.to_string()),
|
||||||
|
"/" => args_with_operator.push(string.to_string()),
|
||||||
|
_ => string.push(character),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
args_with_operator
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user