Rust: rename MatchExpr.expr to scrutinee in all layers

This doesn't require `ql.name` and is simpler while we don't have
to write upgrade scripts. The `ql.name` mechanism might get useful
once we do have to write upgrade scripts, as that doesn't change the
dbscheme.
This commit is contained in:
Paolo Tranquilli
2024-11-26 10:42:13 +01:00
parent 93e7202a69
commit 8a01161d4a
9 changed files with 13 additions and 12 deletions

View File

@@ -1,2 +1,2 @@
mod.rs 4bcb9def847469aae9d8649461546b7c21ec97cf6e63d3cf394e339915ce65d7 4bcb9def847469aae9d8649461546b7c21ec97cf6e63d3cf394e339915ce65d7
top.rs 4504ceb7e13020d5b19a4b938395fa2d5d804a962743985efe8563903448ae0c 4504ceb7e13020d5b19a4b938395fa2d5d804a962743985efe8563903448ae0c
top.rs abab6a736e75f9eabbe31deef4de782fc05f0c053798a01d410fffc859515278 abab6a736e75f9eabbe31deef4de782fc05f0c053798a01d410fffc859515278

View File

@@ -5530,7 +5530,7 @@ impl From<trap::Label<MacroType>> for trap::Label<TypeRef> {
pub struct MatchExpr {
pub id: trap::TrapId<MatchExpr>,
pub attrs: Vec<trap::Label<Attr>>,
pub expr: Option<trap::Label<Expr>>,
pub scrutinee: Option<trap::Label<Expr>>,
pub match_arm_list: Option<trap::Label<MatchArmList>>,
}
@@ -5544,8 +5544,8 @@ impl trap::TrapEntry for MatchExpr {
for (i, v) in self.attrs.into_iter().enumerate() {
out.add_tuple("match_expr_attrs", vec![id.into(), i.into(), v.into()]);
}
if let Some(v) = self.expr {
out.add_tuple("match_expr_exprs", vec![id.into(), v.into()]);
if let Some(v) = self.scrutinee {
out.add_tuple("match_expr_scrutinees", vec![id.into(), v.into()]);
}
if let Some(v) = self.match_arm_list {
out.add_tuple("match_expr_match_arm_lists", vec![id.into(), v.into()]);

View File

@@ -1224,12 +1224,12 @@ impl Translator<'_> {
pub(crate) fn emit_match_expr(&mut self, node: ast::MatchExpr) -> Label<generated::MatchExpr> {
let attrs = node.attrs().map(|x| self.emit_attr(x)).collect();
let expr = node.expr().map(|x| self.emit_expr(x));
let scrutinee = node.expr().map(|x| self.emit_expr(x));
let match_arm_list = node.match_arm_list().map(|x| self.emit_match_arm_list(x));
let label = self.trap.emit(generated::MatchExpr {
id: TrapId::Star,
attrs,
expr,
scrutinee,
match_arm_list,
});
self.emit_location(label, &node);