( rust_env: *const RustCompiledEnv, lowlink_name: LeanOwned, out_buf: LeanByteArray<LeanOwned>, )
| 951 | let addr = match rust_env.compile_state.name_to_addr.get(&name) { |
| 952 | Some(a) => a.clone(), |
| 953 | None => { |
| 954 | return 0; |
| 955 | }, |
| 956 | }; |
| 957 | |
| 958 | // Get the constant (note: contains post-sharing expressions) |
| 959 | let constant = match rust_env.compile_state.env.get_const(&addr) { |
| 960 | Some(c) => c, |
| 961 | None => { |
| 962 | return 0; |
| 963 | }, |
| 964 | }; |
| 965 | |
| 966 | // Extract root expressions from the constant info |
| 967 | let root_exprs: Vec<Arc<IxonExpr>> = match &constant.info { |
| 968 | ConstantInfo::Defn(def) => vec![def.typ.clone(), def.value.clone()], |
| 969 | ConstantInfo::Axio(ax) => vec![ax.typ.clone()], |
| 970 | ConstantInfo::Quot(q) => vec![q.typ.clone()], |
| 971 | ConstantInfo::Recr(rec) => { |
| 972 | let mut exprs = vec![rec.typ.clone()]; |
| 973 | for rule in &rec.rules { |
| 974 | exprs.push(rule.rhs.clone()); |
| 975 | } |
| 976 | exprs |
| 977 | }, |
| 978 | // Projections don't contain expressions directly |
| 979 | ConstantInfo::CPrj(_) |
| 980 | | ConstantInfo::RPrj(_) |
| 981 | | ConstantInfo::IPrj(_) |
| 982 | | ConstantInfo::DPrj(_) => { |
| 983 | vec![] |
| 984 | }, |
| 985 | ConstantInfo::Muts(muts) => { |
| 986 | let mut exprs = Vec::new(); |
| 987 | for mc in muts { |
| 988 | match mc { |
| 989 | ixon::constant::MutConst::Defn(def) => { |
| 990 | exprs.push(def.typ.clone()); |
| 991 | exprs.push(def.value.clone()); |
| 992 | }, |
| 993 | ixon::constant::MutConst::Indc(ind) => { |
| 994 | exprs.push(ind.typ.clone()); |
| 995 | for ctor in &ind.ctors { |
| 996 | exprs.push(ctor.typ.clone()); |
| 997 | } |
| 998 | }, |
| 999 | ixon::constant::MutConst::Recr(rec) => { |
| 1000 | exprs.push(rec.typ.clone()); |
| 1001 | for rule in &rec.rules { |
| 1002 | exprs.push(rule.rhs.clone()); |
| 1003 | } |
| 1004 | }, |
| 1005 | } |
| 1006 | } |
| 1007 | exprs |
| 1008 | }, |
| 1009 | }; |
| 1010 |
nothing calls this directly
no test coverage detected