Protocols and operators mostly
All checks were successful
Rust / build (push) Successful in 4m8s

This commit is contained in:
2026-01-21 22:22:58 +01:00
parent 75b05a2965
commit f38193edcc
33 changed files with 578 additions and 147 deletions

View File

@@ -110,8 +110,9 @@ impl ExecCtx {
(ExprKind::Identity(val.clone()), StackOp::Swap(val))
},
Err(f) => match &*f.kind().read().await {
ExprKind::Arg | ExprKind::Call(..) | ExprKind::Seq(..) | ExprKind::Const(_) =>
panic!("This should not appear outside function bodies"),
ExprKind::Arg | ExprKind::Call(..) | ExprKind::Seq(..) | ExprKind::Const(_) => {
panic!("This should not appear outside function bodies")
},
ExprKind::Missing => panic!("Should have been replaced"),
ExprKind::Atom(a) => {
let x_norm = self.unpack_ident(&x).await;

View File

@@ -155,8 +155,9 @@ async fn print_exprkind<'a>(
) -> FmtUnit {
match &ek {
ExprKind::Arg => "Arg".to_string().into(),
ExprKind::Missing =>
panic!("This variant is swapped into write guards, so a read can never see it"),
ExprKind::Missing => {
panic!("This variant is swapped into write guards, so a read can never see it")
},
ExprKind::Atom(a) => a.print(c).await,
ExprKind::Bottom(e) if e.len() == 1 => format!("Bottom({e})").into(),
ExprKind::Bottom(e) => format!("Bottom(\n\t{}\n)", indent(&e.to_string())).into(),

View File

@@ -211,12 +211,13 @@ impl Extension {
.await
{
Ok(module) => module,
Err(ChildError { kind, .. }) =>
Err(ChildError { kind, .. }) => {
break 'reply Err(match kind {
ChildErrorKind::Private => panic!("Access checking was disabled"),
ChildErrorKind::Constant => api::LsModuleError::IsConstant,
ChildErrorKind::Missing => api::LsModuleError::InvalidPath,
}),
});
},
};
let mut members = std::collections::HashMap::new();
for (k, v) in &module.members {

View File

@@ -158,14 +158,15 @@ impl System {
}
match cmod.imports.get(selector) {
Some(Ok(dest)) => return Ok(dest.target.to_vname().suffix(tail.iter().cloned())),
Some(Err(dests)) =>
Some(Err(dests)) => {
return Err(mk_errv_floating(
is("Ambiguous name").await,
format!(
"{selector} could refer to {}",
dests.iter().map(|ri| &ri.target).display("or")
),
)),
));
},
None => (),
}
if root_data.root.members.get(selector).is_some() {