cl-interpret: Tuple structs + fix tuple member access

This commit is contained in:
2025-02-22 03:31:27 -06:00
parent 697d139cfd
commit 7a8da33de9
4 changed files with 147 additions and 40 deletions

View File

@@ -940,6 +940,14 @@ mod path {
}
}
/// Checks whether this path ends in the given [Sym]
pub fn ends_with(&self, name: &Sym) -> bool {
match self.parts.as_slice() {
[.., PathPart::Ident(last)] => name == last,
_ => false,
}
}
/// Checks whether this path refers to the sinkhole identifier, `_`
pub fn is_sinkhole(&self) -> bool {
if let [PathPart::Ident(id)] = self.parts.as_slice() {