Skip to content

Commit

Permalink
Rename the bound module to natural.
Browse files Browse the repository at this point in the history
This change completes collapsing and moving the `invariant::natural`
module into `variance::bound`, which is now `variance::natural`.
  • Loading branch information
olson-sean-k committed Mar 26, 2024
1 parent 6e1d3f5 commit 0d9df1e
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/token/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ use crate::token::walk::{BranchFold, Fold, FoldMap, Starting, TokenEntry};
use crate::{StrExt as _, PATHS_ARE_CASE_INSENSITIVE};

pub use crate::token::parse::{parse, ParseError, ROOT_SEPARATOR_EXPRESSION};
pub use crate::token::variance::bound::{BoundedVariantRange, NaturalRange, VariantRange};
pub use crate::token::variance::invariant::{Breadth, Depth, Invariant, Size, Text};
pub use crate::token::variance::natural::{BoundedVariantRange, NaturalRange, VariantRange};
pub use crate::token::variance::{Boundedness, TokenVariance, Variance};

// TODO: Tree representations of expressions are intrusive and only differ in their annotations.
Expand Down
2 changes: 1 addition & 1 deletion src/token/variance/invariant/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ mod text;

use std::num::NonZeroUsize;

use crate::token::variance::bound::{
use crate::token::variance::natural::{
define_natural_invariant, BoundedVariantRange, OpenedUpperBound,
};
use crate::token::variance::ops::{self, Conjunction, Disjunction, Product};
Expand Down
2 changes: 1 addition & 1 deletion src/token/variance/invariant/text.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ use std::collections::VecDeque;
use std::num::NonZeroUsize;

use crate::encode;
use crate::token::variance::bound::VariantRange;
use crate::token::variance::invariant::{Invariant, UnitBound, Zero};
use crate::token::variance::natural::VariantRange;
use crate::token::variance::ops::{self, Conjunction, Disjunction, Product};
use crate::token::variance::{Boundedness, TokenVariance, Variance};
use crate::PATHS_ARE_CASE_INSENSITIVE;
Expand Down
10 changes: 5 additions & 5 deletions src/token/variance/mod.rs
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
pub mod bound;
pub mod invariant;
pub mod natural;
pub mod ops;

use itertools::Itertools;
use std::marker::PhantomData;
use std::num::NonZeroUsize;

use crate::token::variance::bound::{
BoundedVariantRange, NaturalRange, OpenedUpperBound, VariantRange,
};
use crate::token::variance::invariant::{
BoundaryTerm, Breadth, Depth, Finalize, Invariant, InvariantBound, InvariantTerm, One,
SeparatedTerm, Termination, Text, UnitBound, Zero,
};
use crate::token::variance::natural::{
BoundedVariantRange, NaturalRange, OpenedUpperBound, VariantRange,
};
use crate::token::variance::ops::{Conjunction, Disjunction, Product};
use crate::token::walk::{ChildToken, Fold, Forward, ParentToken, Sequencer};
use crate::token::{Boundary, BranchKind, LeafKind};
Expand Down Expand Up @@ -448,8 +448,8 @@ where
pub mod harness {
use std::fmt::Debug;

use crate::token::variance::bound::{BoundedVariantRange, NaturalRange};
use crate::token::variance::invariant::{Invariant, UnitBound};
use crate::token::variance::natural::{BoundedVariantRange, NaturalRange};
use crate::token::variance::{TokenVariance, TreeVariance, Variance};
use crate::token::{Fold, TokenTree, Tokenized};

Expand Down
4 changes: 2 additions & 2 deletions src/token/variance/bound.rs → src/token/variance/natural.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ macro_rules! impl_natural_invariant {
const _: () = {
use std::num::NonZeroUsize;

use $crate::token::variance::bound::{BoundedVariantRange, VariantRange};
use $crate::token::variance::invariant::{Invariant, One, Zero};
use $crate::token::variance::natural::{BoundedVariantRange, VariantRange};
use $crate::token::variance::ops::{self, Conjunction, Disjunction, Product};
use $crate::token::variance::{
Bounded, Boundedness, TokenVariance, Unbounded, Variance,
Expand Down Expand Up @@ -153,7 +153,7 @@ macro_rules! define_natural_invariant {
#[repr(transparent)]
pub struct $name(usize);

$crate::token::variance::bound::impl_natural_invariant!($name => $term);
$crate::token::variance::natural::impl_natural_invariant!($name => $term);
};
}
pub use define_natural_invariant;
Expand Down
2 changes: 1 addition & 1 deletion src/token/walk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use std::collections::VecDeque;
use crate::filter::{
CancelWalk, HierarchicalIterator, Isomeric, SeparatingFilterInput, Separation, TreeResidue,
};
use crate::token::variance::bound::NaturalRange;
use crate::token::variance::natural::NaturalRange;
use crate::token::{
Alternation, BranchKind, Composition, Concatenation, LeafKind, Repetition, Token,
TokenTopology, TokenTree,
Expand Down

0 comments on commit 0d9df1e

Please sign in to comment.