started working on new tokeniser

This commit is contained in:
2026-05-16 21:11:45 +01:00
parent 94422b307c
commit 0c28bc113d
6 changed files with 125 additions and 30 deletions
+4 -4
View File
@@ -23,7 +23,7 @@ pub fn token_parse(
tokens: &Vec<&str>,
characters: &Arc<Mutex<HashMap::<String, character::Character>>>,
data_to_send: &Arc<Mutex<api::DataToSend>>,
rx: &Receiver<(bool,usize)>,
rx: &Receiver<(bool,usize,String)>,
) -> Result<(),String>
{
info!("DSL parsing begun");
@@ -76,13 +76,13 @@ pub fn token_parse(
Err(error) => return Err(error),
};
if rx.recv().is_err() { warn!("Error sending choices to client"); }
let (_, choice) = match rx.recv()
let (_, choice, _) = match rx.recv()
{
Ok((_,choice)) => (None::<bool>, choice),
Ok((_,choice,_)) => (None::<bool>, choice, None::<String>),
Err(err) =>
{
warn!("Error receiving choice from client, defaulting to choice 0 {err}");
(None::<bool>, 0)
(None::<bool>, 0, None::<String>)
}
};
index = jump_points[choice];