diff --git a/src/parse.rs b/src/parse.rs index cf03772..7e26c35 100644 --- a/src/parse.rs +++ b/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 -pub fn arguments(){ - -} \ No newline at end of file +pub fn arguments(args_to_process: Vec) { + // trouver les operateurs et separer les membres de l'expression + for argument in args_to_process {} +} + +fn find_operator(argument: String) -> Vec { + 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 +}