Constructs a projection expression (type name, field index, struct expr).
(n: Name, i: Nat, e: Expr)
| 942 | }; |
| 943 | Expr(Arc::new(ExprData::Lit(x, hasher.finalize()))) |
| 944 | } |
| 945 | |
| 946 | /// Constructs a metadata-annotated expression. |
| 947 | pub fn mdata(xs: Vec<(Name, DataValue)>, e: Expr) -> Self { |
| 948 | let mut hasher = blake3::Hasher::new(); |
| 949 | hasher.update(&[EMDATA]); |
| 950 | hasher.update(&Nat::from(xs.len() as u64).to_le_bytes()); |
| 951 | for (name, dv) in &xs { |
| 952 | hasher.update(name.get_hash().as_bytes()); |
| 953 | hash_data_value(dv, &mut hasher); |
| 954 | } |