Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
81 commits
Select commit Hold shift + click to select a range
4abbb0f
Scaffold cgp-macro-core crate
soareschen May 17, 2026
92171d0
Scaffold Symbol impls
soareschen May 17, 2026
02d96af
Implement UniPath
soareschen May 17, 2026
605bba0
Use UniPath in UseNamespaceAttribute
soareschen May 17, 2026
f043a69
Add cgp-base and cgp-base-types crates
soareschen May 17, 2026
bf10579
Move path types
soareschen May 17, 2026
1ee8022
Remove PathNil
soareschen May 17, 2026
eccb29f
Rename cgp_component::types to providers
soareschen May 17, 2026
5bed597
Use UniPath in NamespaceEntry
soareschen May 17, 2026
f7d6e88
Split out derive_namespace
soareschen May 17, 2026
8a953f5
Move ImplGenerics
soareschen May 17, 2026
5bff570
Use PathElement in PathHead
soareschen May 17, 2026
55a6695
Move PathHead
soareschen May 17, 2026
0d9d729
Refactor PathHead
soareschen May 17, 2026
39d37a7
Implement PathHead::into_paths
soareschen May 17, 2026
8e7a48e
Implement NonEmptyPathHead
soareschen May 17, 2026
03891d2
Implement PathHeadOrType
soareschen May 17, 2026
1a4a9c4
Use PathHeadOrType in NamespaceSpec
soareschen May 17, 2026
56b08db
Simplify prefix delegation in cgp_namespace
soareschen May 17, 2026
0f7bb29
Implicitly append component name in namespace
soareschen May 17, 2026
1c4c611
Use `@path in namespace` syntax
soareschen May 17, 2026
1fe502d
Rename #[namespace] to #[prefix]
soareschen May 17, 2026
b109038
Move TypeGenerics
soareschen May 20, 2026
992263d
Add NamespaceIdent
soareschen May 20, 2026
4affe2e
Experiment on generic defaults
soareschen May 20, 2026
f09cb68
Fully qualify type paths
soareschen May 20, 2026
0cc23ab
Reimplementing DelegateEntry
soareschen May 20, 2026
6211b88
Add PathDelegateKey
soareschen May 20, 2026
fc9fccd
Reorganize DelegateEntry constructs
soareschen May 21, 2026
bdbd37b
Add keyword constructs
soareschen May 21, 2026
3f6675f
Implement PeekKeyword
soareschen May 21, 2026
2196451
Implement NamespaceDelegateEntry
soareschen May 21, 2026
1b1d365
Implement EvalDelegateEntry
soareschen May 21, 2026
45d649f
Reorganize DelegateKey constructs
soareschen May 21, 2026
6880d6b
Implement EvalDelegateKey
soareschen May 21, 2026
ce512a0
Reorganize DelegateValue constructs
soareschen May 22, 2026
c4903ae
Implement EvalDelegateValue
soareschen May 23, 2026
e7cd6ed
Implement EvalDelegateEntry for Normal and DirectDelegateEntry
soareschen May 23, 2026
6ab17e4
Add namespace variant to DelegateEntry
soareschen May 23, 2026
84cfa63
Add open variant to DelegateEntry
soareschen May 23, 2026
7cee982
Derive DelegateComponent and IsProviderFor in EvaluatedDelegateEntry
soareschen May 23, 2026
ff6d856
Rename context_type to table_type in EvalDelegateEntry
soareschen May 23, 2026
78b299e
Implement DelegateTable
soareschen May 23, 2026
308d0ce
Add `new` keyword
soareschen May 23, 2026
0f8e82a
Implement ProviderStruct
soareschen May 23, 2026
fb343de
Remove define_struct
soareschen May 23, 2026
857d13f
Derive Debug and Clone
soareschen May 23, 2026
cf11ccc
Implement ExtractInnerDelegateTables
soareschen May 23, 2026
dab0faa
Implement build_impls
soareschen May 23, 2026
570f108
Update namespace and open syntax
soareschen May 23, 2026
781d0e0
Implement eval for DelegateTable
soareschen May 23, 2026
3c64acb
Parsing new DelegateTable is working
soareschen May 23, 2026
d64d53f
New delegate_components! is working
soareschen May 23, 2026
444d832
Fixing namespace expansion
soareschen May 23, 2026
9d56a84
Fixed namespace expansion
soareschen May 23, 2026
06ee26b
Remove old DelegateComponent constructs
soareschen May 23, 2026
a060e3f
Use back semicolon for delegate statements
soareschen May 24, 2026
1f1ae5d
Rename DelegateEntry to DelegateMapping
soareschen May 24, 2026
381ed20
Reorganize statement modules
soareschen May 25, 2026
905dbe0
Reorganize mapping constructs
soareschen May 25, 2026
23c4546
Rename mapping and statement constructs
soareschen May 25, 2026
1268856
Scaffold parsing for for statement
soareschen May 25, 2026
fdcae74
For statement is now working
soareschen May 25, 2026
4e8bc25
Implement EvaluatedForEntry
soareschen May 25, 2026
893f353
Implement EvalForEntry for NamespaceDelegateStatement
soareschen May 25, 2026
8fd03a9
Draft implement RedirectDelegateMapping
soareschen May 25, 2026
d8f9797
Redirect mapping is working
soareschen May 25, 2026
5f07f6f
Draft implement NamespaceTable
soareschen May 25, 2026
e23ca0d
Handle parent namespace
soareschen May 25, 2026
02d04b1
Still fixing namespace inheritance
soareschen May 25, 2026
5e36713
New namespace inheritance is now working
soareschen May 25, 2026
f943d76
Remove old namespace constructs
soareschen May 25, 2026
b377928
Move NamespaceTable
soareschen May 25, 2026
a963114
Only allow inheritance in new namespaces
soareschen May 25, 2026
a621b95
Rename `Provider` to `Delegate` in namespace traits
soareschen May 26, 2026
3ed9351
Always require namespace ident to be specified
soareschen May 26, 2026
2131598
Implement InheritNamespaceStatement
soareschen May 26, 2026
641bcc7
Use InheritNamespaceStatement to derive namespace impl
soareschen May 26, 2026
2284490
Slight refactoring
soareschen May 26, 2026
f9cf4d3
Fix clippy
soareschen May 26, 2026
4eb1e7f
Fix clippy
soareschen May 26, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 28 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,14 @@ resolver = "3"

members = [
"crates/cgp",
"crates/cgp-base",
"crates/cgp-base-types",
"crates/cgp-core",
"crates/cgp-extra",
"crates/cgp-async-macro",
"crates/cgp-component",
"crates/cgp-macro",
"crates/cgp-macro-core",
"crates/cgp-macro-lib",
"crates/cgp-type",
"crates/cgp-field",
Expand Down Expand Up @@ -38,11 +41,14 @@ keywords = ["cgp"]

[workspace.dependencies]
cgp = { version = "0.7.0", path = "./crates/cgp" }
cgp-base = { version = "0.7.0", path = "./crates/cgp-base" }
cgp-base-types = { version = "0.7.0", path = "./crates/cgp-base-types" }
cgp-core = { version = "0.7.0", path = "./crates/cgp-core" }
cgp-extra = { version = "0.7.0", path = "./crates/cgp-extra" }
cgp-async-macro = { version = "0.7.0", path = "./crates/cgp-async-macro" }
cgp-component = { version = "0.7.0", path = "./crates/cgp-component" }
cgp-macro = { version = "0.7.0", path = "./crates/cgp-macro" }
cgp-macro-core = { version = "0.7.0", path = "./crates/cgp-macro-core" }
cgp-macro-lib = { version = "0.7.0", path = "./crates/cgp-macro-lib" }
cgp-type = { version = "0.7.0", path = "./crates/cgp-type" }
cgp-field = { version = "0.7.0", path = "./crates/cgp-field" }
Expand Down
11 changes: 11 additions & 0 deletions crates/cgp-base-types/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[package]
name = "cgp-base-types"
version = "0.7.0"
edition = { workspace = true }
license = { workspace = true }
repository = { workspace = true }
authors = { workspace = true }
rust-version = { workspace = true }
keywords = { workspace = true }

[dependencies]
5 changes: 5 additions & 0 deletions crates/cgp-base-types/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#![allow(non_camel_case_types)]

pub mod macro_prelude;
pub mod traits;
pub mod types;
2 changes: 2 additions & 0 deletions crates/cgp-base-types/src/macro_prelude.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
pub use crate::traits::ConcatPath;
pub use crate::types::*;
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
use core::marker::PhantomData;

pub struct PathCons<Head: ?Sized, Tail: ?Sized>(pub PhantomData<Head>, pub PhantomData<Tail>);

pub struct PathNil;
use crate::types::{Nil, PathCons};

pub trait ConcatPath<Other: ?Sized> {
type Output: ?Sized;
Expand All @@ -15,6 +11,6 @@ where
type Output = PathCons<Head, <Tail as ConcatPath<Other>>::Output>;
}

impl<Other: ?Sized> ConcatPath<Other> for PathNil {
impl<Other: ?Sized> ConcatPath<Other> for Nil {
type Output = Other;
}
5 changes: 5 additions & 0 deletions crates/cgp-base-types/src/traits/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
mod concat_path;
mod static_format;

pub use concat_path::*;
pub use static_format::*;
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,4 @@
#[allow(non_camel_case_types)]
pub struct π<Head, Tail>(pub Head, pub Tail);

/**
The `Nil` type, a.k.a. `ε`, is used to represent the end of a _type-level list_,
or an empty type-level list.

`Nil` is commonly used as the `Tail` of a [`Cons`] type, to terminate the list.
When used on its own, it represents an empty type-level list.

Read more about type-level lists, a.k.a. the product types, in [`Cons`].
*/
#[derive(Eq, PartialEq, Clone, Default, Debug)]
#[allow(non_camel_case_types)]
pub struct ε;

pub use ε as Nil;
pub use π as Cons;
11 changes: 11 additions & 0 deletions crates/cgp-base-types/src/types/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
mod chars;
mod cons;
mod nil;
mod path;
mod symbol;

pub use chars::*;
pub use cons::*;
pub use nil::*;
pub use path::*;
pub use symbol::*;
14 changes: 14 additions & 0 deletions crates/cgp-base-types/src/types/nil.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/**
The `Nil` type, a.k.a. `ε`, is used to represent the end of a _type-level list_,
or an empty type-level list.

`Nil` is commonly used as the `Tail` of a [`Cons`] type, to terminate the list.
When used on its own, it represents an empty type-level list.

Read more about type-level lists, a.k.a. the product types, in [`Cons`].
*/
#[derive(Eq, PartialEq, Clone, Default, Debug)]
#[allow(non_camel_case_types)]
pub struct ε;

pub use ε as Nil;
3 changes: 3 additions & 0 deletions crates/cgp-base-types/src/types/path.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
use core::marker::PhantomData;

pub struct PathCons<Head: ?Sized, Tail: ?Sized>(pub PhantomData<Head>, pub PhantomData<Tail>);
14 changes: 14 additions & 0 deletions crates/cgp-base/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[package]
name = "cgp-base"
version = "0.7.0"
edition = { workspace = true }
license = { workspace = true }
repository = { workspace = true }
authors = { workspace = true }
rust-version = { workspace = true }
keywords = { workspace = true }

[dependencies]
cgp-base-types = { workspace = true }
cgp-component = { workspace = true }
cgp-macro = { workspace = true }
1 change: 1 addition & 0 deletions crates/cgp-base/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pub mod macro_prelude;
2 changes: 2 additions & 0 deletions crates/cgp-base/src/macro_prelude.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
pub use cgp_base_types::macro_prelude::*;
pub use cgp_component::macro_prelude::*;
13 changes: 7 additions & 6 deletions crates/cgp-component/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@
CGP component implementation.
*/

pub mod macro_prelude;

mod namespaces;
mod providers;
mod traits;
mod types;

pub use namespaces::DefaultNamespace;
pub use traits::{CanUseComponent, DelegateComponent, IsProviderFor};
pub use types::{
ConcatPath, PathCons, PathNil, RedirectLookup, UseContext, UseDefault, UseDelegate, UseFields,
WithContext, WithProvider,
pub use namespaces::{DefaultImpls1, DefaultImpls2, DefaultNamespace};
pub use providers::{
RedirectLookup, UseContext, UseDefault, UseDelegate, UseFields, WithContext, WithProvider,
};
pub use traits::{CanUseComponent, DelegateComponent, IsProviderFor};
5 changes: 5 additions & 0 deletions crates/cgp-component/src/macro_prelude.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pub use crate::namespaces::DefaultNamespace;
pub use crate::providers::{
RedirectLookup, UseContext, UseDefault, UseDelegate, UseFields, WithContext, WithProvider,
};
pub use crate::traits::{CanUseComponent, DelegateComponent, IsProviderFor};
10 changes: 9 additions & 1 deletion crates/cgp-component/src/namespaces.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
pub trait DefaultNamespace<Components> {
type Provider;
type Delegate;
}

pub trait DefaultImpls1<T, Components> {
type Delegate;
}

pub trait DefaultImpls2<T1, T2, Components> {
type Delegate;
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
mod path;
mod redirect_lookup;
mod use_context;
mod use_default;
mod use_delegate;
mod use_fields;
mod with_provider;

pub use path::{ConcatPath, PathCons, PathNil};
pub use redirect_lookup::RedirectLookup;
pub use use_context::{UseContext, WithContext};
pub use use_default::UseDefault;
Expand Down
1 change: 1 addition & 0 deletions crates/cgp-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ description = """
"""

[dependencies]
cgp-base = { workspace = true }
cgp-async-macro = { workspace = true }
cgp-component = { workspace = true }
cgp-macro = { workspace = true }
Expand Down
1 change: 1 addition & 0 deletions crates/cgp-core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

pub mod prelude;

pub use prelude as macro_prelude;
#[doc(inline)]
pub use {
cgp_async_macro::async_trait, cgp_component as component, cgp_error as error,
Expand Down
5 changes: 3 additions & 2 deletions crates/cgp-core/src/prelude.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
pub use core::marker::PhantomData;

pub use cgp_async_macro::async_trait;
pub use cgp_base::macro_prelude::{ConcatPath, PathCons};
pub use cgp_component::{
CanUseComponent, ConcatPath, DefaultNamespace, DelegateComponent, IsProviderFor, PathCons,
PathNil, RedirectLookup, UseContext, UseDelegate, UseFields, WithContext, WithProvider,
CanUseComponent, DefaultNamespace, DelegateComponent, IsProviderFor, RedirectLookup,
UseContext, UseDelegate, UseFields, WithContext, WithProvider,
};
pub use cgp_error::{CanRaiseError, CanWrapError, HasErrorType};
pub use cgp_field::impls::{IsMut, IsNothing, IsPresent, IsRef, IsVoid, UseField};
Expand Down
2 changes: 1 addition & 1 deletion crates/cgp-dispatch/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ keywords = { workspace = true }
description = "Extensible data type dispatchers for CGP handlers"

[dependencies]
cgp-core = { workspace = true }
cgp = { version = "0.7.0", path = "../cgp-core", package = "cgp-core" }
cgp-monad = { workspace = true }
cgp-handler = { workspace = true }
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use cgp_core::field::traits::MapFields;
use cgp_core::prelude::*;
use cgp::field::traits::MapFields;
use cgp::prelude::*;
use cgp_handler::{
ComputerComponent, ComputerRefComponent, HandlerComponent, HandlerRefComponent,
TryComputerComponent, TryComputerRefComponent,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use cgp_core::field::impls::CanBuildFrom;
use cgp_core::prelude::*;
use cgp::field::impls::CanBuildFrom;
use cgp::prelude::*;
use cgp_handler::{
Computer, ComputerComponent, Handler, HandlerComponent, TryComputer, TryComputerComponent,
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use cgp_core::prelude::*;
use cgp::prelude::*;
use cgp_handler::{
Computer, ComputerComponent, Handler, HandlerComponent, TryComputer, TryComputerComponent,
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use cgp_core::prelude::*;
use cgp::prelude::*;
use cgp_handler::{AsyncComputer, AsyncComputerComponent, Computer, ComputerComponent};

pub struct ExtractFieldAndHandle<Tag, Provider = UseContext>(pub PhantomData<(Tag, Provider)>);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use cgp_core::prelude::*;
use cgp::prelude::*;
use cgp_handler::{AsyncComputer, AsyncComputerComponent, Computer, ComputerComponent};

pub struct ExtractFirstFieldAndHandle<Tag, Provider = UseContext>(pub PhantomData<(Tag, Provider)>);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use cgp_core::field::impls::CanDowncastFields;
use cgp_core::prelude::*;
use cgp::field::impls::CanDowncastFields;
use cgp::prelude::*;
use cgp_handler::{AsyncComputer, AsyncComputerComponent, Computer, ComputerComponent};

pub struct DowncastAndHandle<Input, Provider = UseContext>(pub PhantomData<(Input, Provider)>);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use cgp_core::prelude::*;
use cgp::prelude::*;
use cgp_handler::{AsyncComputer, AsyncComputerComponent, Computer, ComputerComponent};

pub struct HandleFieldValue<Provider = UseContext>(pub PhantomData<Provider>);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use cgp_core::prelude::*;
use cgp::prelude::*;
use cgp_handler::{AsyncComputer, AsyncComputerComponent, Computer, ComputerComponent};

pub struct HandleFirstFieldValue<Provider = UseContext>(pub PhantomData<Provider>);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use cgp_core::prelude::*;
use cgp::prelude::*;
use cgp_handler::UseInputDelegate;

use crate::providers::matchers::to_field_handlers::{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use cgp_core::prelude::*;
use cgp::prelude::*;
use cgp_handler::{
AsyncComputerComponent, AsyncComputerRefComponent, ComputerComponent, ComputerRefComponent,
HandlerComponent, HandlerRefComponent, PromoteRef, TryComputerComponent,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use cgp_core::prelude::*;
use cgp::prelude::*;

use crate::{ExtractFieldAndHandle, ExtractFirstFieldAndHandle};

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use cgp_core::prelude::*;
use cgp::prelude::*;
use cgp_handler::{
Computer, ComputerComponent, Handler, HandlerComponent, PipeHandlers, TryComputer,
TryComputerComponent,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use core::marker::PhantomData;

use cgp_core::prelude::*;
use cgp::prelude::*;
use cgp_handler::{AsyncComputer, AsyncComputerComponent, Computer, ComputerComponent};

use crate::DispatchMatchers;
Expand Down
Loading
Loading