basic parsing

This commit is contained in:
Folkert 2021-04-14 13:03:31 +02:00
parent 063c039003
commit 64bc92c746
7 changed files with 140 additions and 20 deletions

View file

@ -1401,6 +1401,8 @@ where
look_up_builtins,
);
dbg!(&result);
match result {
Ok(()) => {}
Err(LoadingProblem::MsgChannelDied) => {
@ -1554,14 +1556,41 @@ where
// This is where most of the main thread's work gets done.
// Everything up to this point has been setting up the threading
// system which lets this logic work efficiently.
state = update(
let constrained_ident_ids = state.constrained_ident_ids.clone();
let arc_modules = state.arc_modules.clone();
let res_state = update(
state,
msg,
msg_tx.clone(),
&injector,
worker_listeners,
arena,
)?;
);
match res_state {
Ok(new_state) => {
state = new_state;
}
Err(LoadingProblem::ParsingFailed(problem)) => {
shut_down_worker_threads!();
let module_ids = Arc::try_unwrap(arc_modules)
.unwrap_or_else(|_| {
panic!(r"There were still outstanding Arc references to module_ids")
})
.into_inner()
.into_module_ids();
let buf = to_parse_problem_report(
problem,
module_ids,
constrained_ident_ids,
);
return Err(LoadingProblem::FormattedReport(buf));
}
Err(e) => return Err(e),
}
}
}
}