cl-ast: Fix AddrOf misbehavior

This commit is contained in:
2025-01-29 03:31:24 -06:00
parent bc955c6409
commit 518fbe74a1
7 changed files with 24 additions and 28 deletions

View File

@@ -681,13 +681,9 @@ impl Interpret for ArrayRep {
}
impl Interpret for AddrOf {
fn interpret(&self, env: &mut Environment) -> IResult<ConValue> {
let Self { count: _, mutable: _, expr } = self;
let Self { mutable: _, expr } = self;
match expr.as_ref() {
ExprKind::Index(_) => todo!("AddrOf array index"),
// ExprKind::Path(Path { absolute: false, parts }) => match parts.as_slice() {
// [PathPart::Ident(id)] => env.get_ref(id),
// _ => todo!("Path traversal in addrof"),
// },
ExprKind::Path(_) => todo!("Path traversal in addrof"),
_ => Ok(ConValue::Ref(Rc::new(expr.interpret(env)?))),
}