mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-30 23:31:12 +00:00
basic parsing
This commit is contained in:
parent
063c039003
commit
64bc92c746
7 changed files with 140 additions and 20 deletions
|
@ -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),
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue