Skip to content

Commit

Permalink
Rename ScopeExt
Browse files Browse the repository at this point in the history
  • Loading branch information
AZWN committed Jun 13, 2024
1 parent 01e8786 commit 632a822
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions scopegraphs/examples/records/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use crate::ast::{Expr, Program, RecordDef, Type};
use crate::queries::{resolve_lexical_ref, resolve_member_ref, resolve_record_ref};
use async_recursion::async_recursion;
use futures::future::join;
use scopegraphs::completeness::{FutureCompleteness, ScopeExt};
use scopegraphs::completeness::{FutureCompleteness, ScopeExtPerm};
use scopegraphs::render::{RenderScopeData, RenderScopeLabel, RenderSettings};
use scopegraphs::{add_scope, Scope, ScopeGraph, Storage};
use scopegraphs_macros::Label;
Expand Down Expand Up @@ -95,7 +95,7 @@ enum PartialType {
}

type RecordScopegraph<'sg> = ScopeGraph<'sg, SgLabel, SgData, FutureCompleteness<SgLabel>>;
type SgScopeExt<'sg> = ScopeExt<'sg, SgLabel, SgData, FutureCompleteness<SgLabel>>;
type SgScopeExt<'sg> = ScopeExtPerm<'sg, SgLabel, SgData, FutureCompleteness<SgLabel>>;

struct TypeChecker<'sg, 'ex> {
sg: &'sg RecordScopegraph<'sg>,
Expand Down
12 changes: 6 additions & 6 deletions scopegraphs/src/completeness/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ pub trait Implicit<LABEL: Label, DATA>: Completeness<LABEL, DATA> {}
/// Represents the permission to extend a scope with a particular label.
///
/// Do not instantiate this struct manually, but use the [add_scope] macro instead.
pub struct ScopeExt<
pub struct ScopeExtPerm<
'ext,
LABEL: Hash + Label + Debug, /* <= Bound here required for Drop implementation */
DATA,
Expand All @@ -140,7 +140,7 @@ pub struct ScopeExt<
_data: PhantomData<DATA>, // FIXME: required for using `where CMPL: UserClosed<LABEL, DATA>` in impl blocks. Can it be removed some way?
}

impl<'ext, LABEL: Hash + Label + Debug, DATA, CMPL> Drop for ScopeExt<'ext, LABEL, DATA, CMPL>
impl<'ext, LABEL: Hash + Label + Debug, DATA, CMPL> Drop for ScopeExtPerm<'ext, LABEL, DATA, CMPL>
where
CMPL: UserClosed<LABEL, DATA>,
{
Expand All @@ -152,7 +152,7 @@ where
}

impl<'ext, LABEL: Hash + Label + Debug, DATA, CMPL: UserClosed<LABEL, DATA>>
ScopeExt<'ext, LABEL, DATA, CMPL>
ScopeExtPerm<'ext, LABEL, DATA, CMPL>
where
CMPL: UserClosed<LABEL, DATA>,
{
Expand All @@ -162,8 +162,8 @@ where
scope: Scope,
label: LABEL,
sg: &'ext ScopeGraph<'storage, LABEL, DATA, CMPL>,
) -> ScopeExt<'ext, LABEL, DATA, CMPL> {
ScopeExt {
) -> ScopeExtPerm<'ext, LABEL, DATA, CMPL> {
ScopeExtPerm {
scope,
label,
sg: &sg.completeness,
Expand Down Expand Up @@ -279,7 +279,7 @@ macro_rules! add_scope {
let scope = sg.add_scope_with(data, [$($lbl),*]);

// return the scope, and the extension permissions
(scope, $(unsafe { $crate::completeness::ScopeExt::init(scope, $lbl, sg) }),*)
(scope, $(unsafe { $crate::completeness::ScopeExtPerm::init(scope, $lbl, sg) }),*)
}
};

Expand Down
6 changes: 3 additions & 3 deletions scopegraphs/src/scopegraph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use std::{
hash::Hash,
};

use crate::completeness::{Completeness, Implicit, ScopeExt, UncheckedCompleteness, UserClosed};
use crate::completeness::{Completeness, Implicit, ScopeExtPerm, UncheckedCompleteness, UserClosed};
use crate::label::ArrayInit;
use crate::storage::Storage;
use crate::Label;
Expand Down Expand Up @@ -228,7 +228,7 @@ where
/// Permission for this is checked by `CMPL`.
pub fn ext_edge<'ext>(
&'ext self,
ext: &ScopeExt<'ext, LABEL, DATA, CMPL>,
ext: &ScopeExtPerm<'ext, LABEL, DATA, CMPL>,
dst: Scope,
) -> CMPL::NewEdgeResult {
self.completeness
Expand All @@ -247,7 +247,7 @@ where
/// ```
pub fn ext_decl<'ext>(
&'ext self,
ext: &ScopeExt<'ext, LABEL, DATA, CMPL>,
ext: &ScopeExtPerm<'ext, LABEL, DATA, CMPL>,
data: DATA,
) -> CMPL::NewEdgeResult {
// Create scope with no open edges.
Expand Down

0 comments on commit 632a822

Please sign in to comment.