From 4b7c4a4a73d11622173dd663f0eb06e63e9bae43 Mon Sep 17 00:00:00 2001 From: Hatmos Date: Tue, 7 Jul 2026 19:06:36 +0200 Subject: [PATCH] debut de parsing --- src/parse.rs | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) 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 +}