remove missed access file

This commit is contained in:
gluax 2022-05-03 09:53:46 -07:00
parent 18bd03318f
commit 46bd62870d

View File

@ -1,54 +0,0 @@
// Copyright (C) 2019-2022 Aleo Systems Inc.
// This file is part of the Leo library.
// The Leo library is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// The Leo library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
use crate::{Expression, Identifier, Node, Type};
use leo_span::Span;
use serde::{Deserialize, Serialize};
use std::{cell::RefCell, fmt};
/// An access expression to a static member, e.g., a constant in a circuit.
/// An example would be `Foo::Const` or `Foo::function` in `Foo::function()`.
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct StaticAccess {
/// Represents the container for the static member to access.
/// Usually this is a circuit.
pub inner: Box<Expression>,
/// The static member in `inner` that is being accessed.
pub name: Identifier,
/// A refcell type initially (), it is later assigned during type checking if necessary.
// FIXME(Centril): Shouldn't be in an AST. Remove it as part of an architectural revamp.
pub type_: RefCell<Type>,
/// The span for the entire expression `inner::name`.
pub span: Span,
}
impl fmt::Display for StaticAccess {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}::{}", self.inner, self.name)
}
}
impl Node for StaticAccess {
fn span(&self) -> &Span {
&self.span
}
fn set_span(&mut self, span: Span) {
self.span = span;
}
}