Skip to content

Commit

Permalink
AUTO : Forward from format_tools_evolving_5 to alpha (#1460)
Browse files Browse the repository at this point in the history
evolve format_tools
  • Loading branch information
wtools-bot authored Oct 12, 2024
1 parent ebc194a commit 4a090ae
Show file tree
Hide file tree
Showing 54 changed files with 1,237 additions and 354 deletions.
26 changes: 13 additions & 13 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -185,15 +185,15 @@ features = [ "enabled" ]
## mem

[workspace.dependencies.mem_tools]
version = "~0.6.0"
version = "~0.7.0"
path = "module/core/mem_tools"
default-features = false


## diagnostics

[workspace.dependencies.diagnostics_tools]
version = "~0.8.0"
version = "~0.9.0"
path = "module/core/diagnostics_tools"
default-features = false

Expand All @@ -209,12 +209,12 @@ default-features = false
## meta

[workspace.dependencies.meta_tools]
version = "~0.10.0"
version = "~0.11.0"
path = "module/core/meta_tools"
default-features = false

[workspace.dependencies.for_each]
version = "~0.8.0"
version = "~0.9.0"
path = "module/core/for_each"
default-features = false

Expand All @@ -239,16 +239,16 @@ path = "module/core/former_types"
default-features = false

[workspace.dependencies.impls_index]
version = "~0.7.0"
version = "~0.8.0"
path = "module/core/impls_index"
default-features = false

[workspace.dependencies.impls_index_meta]
version = "~0.7.0"
version = "~0.8.0"
path = "module/core/impls_index_meta"

[workspace.dependencies.mod_interface]
version = "~0.25.0"
version = "~0.26.0"
path = "module/core/mod_interface"
default-features = false

Expand Down Expand Up @@ -305,12 +305,12 @@ default-features = false
## typing

[workspace.dependencies.typing_tools]
version = "~0.8.0"
version = "~0.9.0"
path = "module/core/typing_tools"
default-features = false

[workspace.dependencies.implements]
version = "~0.8.0"
version = "~0.9.0"
path = "module/core/implements"
default-features = false

Expand All @@ -320,12 +320,12 @@ path = "module/alias/instance_of"
default-features = false

[workspace.dependencies.inspect_type]
version = "~0.10.0"
version = "~0.11.0"
path = "module/core/inspect_type"
default-features = false

[workspace.dependencies.is_slice]
version = "~0.9.0"
version = "~0.10.0"
path = "module/core/is_slice"
default-features = false

Expand Down Expand Up @@ -381,7 +381,7 @@ default-features = false

[workspace.dependencies.process_tools_published]
package = "process_tools"
version = "~0.8.0"
version = "~0.9.0"
default-features = false


Expand All @@ -392,7 +392,7 @@ version = "~0.4.0"
path = "module/alias/wtest"

[workspace.dependencies.test_tools]
version = "~0.9.0"
version = "~0.10.0"
path = "module/core/test_tools"

[workspace.dependencies.wtest_basic]
Expand Down
2 changes: 1 addition & 1 deletion module/core/diagnostics_tools/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "diagnostics_tools"
version = "0.8.0"
version = "0.9.0"
edition = "2021"
authors = [
"Kostiantyn Wandalen <[email protected]>",
Expand Down
2 changes: 1 addition & 1 deletion module/core/for_each/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "for_each"
version = "0.8.0"
version = "0.9.0"
edition = "2021"
authors = [
"Kostiantyn Wandalen <[email protected]>",
Expand Down
78 changes: 60 additions & 18 deletions module/core/format_tools/src/format.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ mod private
macro_rules! _field_with_key
{
(
$path : expr,
$key : ident,
$src : expr,
$how : ty,
$fallback1 : ty,
$fallback2 : ty
Expand All @@ -28,9 +28,10 @@ mod private
{{
(
::core::stringify!( $key ),
$crate::OptionalCow::< '_, str, $how >::from
// $crate::OptionalCow::< '_, str, $how >::from
Option::Some
(
$crate::to_string_with_fallback!( $how, $fallback1, $fallback2, $src )
$crate::to_string_with_fallback!( $how, $fallback1, $fallback2, $path )
),
)
}};
Expand All @@ -47,39 +48,63 @@ mod private
macro_rules! _field
{

( & $path:ident.$( $key:ident )+, $how : ty, $fallback1 : ty, $fallback2 : ty $(,)? ) =>
// dst.push( field!( &self.id ) );
( ( & $pre:ident.$( $key:tt )+ ), $how : ty, $fallback1 : ty, $fallback2 : ty $(,)? ) =>
{{
$crate::_field!( # ( & $path . ) ( $( $key )+ ) ( $how, $fallback1, $fallback2 ) )
$crate::_field!( # ( & $pre . ) ( $( $key )+ ) ( $how, $fallback1, $fallback2 ) )
}};

( $path:ident.$( $key:ident )+, $how : ty, $fallback1 : ty, $fallback2 : ty $(,)? ) =>
// dst.push( field!( self.id ) );
( ( $pre:ident.$( $key:tt )+ ), $how : ty, $fallback1 : ty, $fallback2 : ty $(,)? ) =>
{{
$crate::_field!( # ( $path . ) ( $( $key )+ ) ( $how, $fallback1, $fallback2 ) )
$crate::_field!( # ( $pre . ) ( $( $key )+ ) ( $how, $fallback1, $fallback2 ) )
}};

( & $key:ident, $how : ty, $fallback1 : ty, $fallback2 : ty $(,)? ) =>
// dst.push( field!( &tools ) );
( ( & $key:ident ), $how : ty, $fallback1 : ty, $fallback2 : ty $(,)? ) =>
{{
$crate::_field!( # () ( $key ) ( $how, $fallback1, $fallback2 ) )
$crate::_field!( # () ( & $key ) ( $how, $fallback1, $fallback2 ) )
}};

( $key:ident, $how : ty, $fallback1 : ty, $fallback2 : ty $(,)? ) =>
// dst.push( field!( tools ) );
( ( $key:ident ), $how : ty, $fallback1 : ty, $fallback2 : ty $(,)? ) =>
{{
$crate::_field!( # () ( $key ) ( $how, $fallback1, $fallback2 ) )
}};

// private

// ( a.b. )
// ( c.d )
// ( $crate::WithRef, $crate::WithDebug, $crate::WithDebug )
(
#
( $( $prefix:tt )* )
( $prekey:ident.$( $field:ident )+ )
( $prekey:ident.$( $field:tt )+ )
( $how : ty, $fallback1 : ty, $fallback2 : ty )
)
=>
{{
$crate::_field!( # ( $( $prefix )* $prekey . ) ( $( $field )+ ) ( $how, $fallback1, $fallback2 ) )
}};

// ( a.b. )
// ( 0.d )
// ( $crate::WithRef, $crate::WithDebug, $crate::WithDebug )
(
#
( $( $prefix:tt )* )
( $prekey:tt.$( $field:tt )+ )
( $how : ty, $fallback1 : ty, $fallback2 : ty )
)
=>
{{
$crate::_field!( # ( $( $prefix )* $prekey . ) ( $( $field )+ ) ( $how, $fallback1, $fallback2 ) )
}};

// ( a.b.c. )
// ( d )
// ( $crate::WithRef, $crate::WithDebug, $crate::WithDebug )
(
#
( $( $prefix:tt )* )
Expand All @@ -91,6 +116,9 @@ mod private
$crate::_field!( # # ( $( $prefix )* ) ( $key ) ( $how, $fallback1, $fallback2 ) )
}};

// ( a.b.c )
// ( d )
// ( $crate::WithRef, $crate::WithDebug, $crate::WithDebug )
(
# #
( $( $prefix:tt )* )
Expand All @@ -99,7 +127,8 @@ mod private
)
=>
{{
$crate::_field_with_key!( $key, $( $prefix )* $key, $how, $fallback1, $fallback2 )
// _field_with_key!( id, &self. id, $crate::WithRef, $crate::WithDisplay, $crate::WithDebugMultiline )
$crate::_field_with_key!( $( $prefix )* $key, $key, $how, $fallback1, $fallback2 )
}};

}
Expand Down Expand Up @@ -129,7 +158,7 @@ mod private
)
=>
{{
$crate::_field_with_key!( $key, $src, $crate::WithRef, $crate::WithDisplay, $crate::WithDebugMultiline )
$crate::_field_with_key!( $src, $key, $crate::WithRef, $crate::WithDisplay, $crate::WithDebugMultiline )
}};
}

Expand All @@ -144,7 +173,7 @@ mod private
( $( $t:tt )+ )
=>
{{
$crate::_field!( $( $t )+, $crate::WithRef, $crate::WithDisplay, $crate::WithDebugMultiline )
$crate::_field!( ( $( $t )+ ), $crate::WithRef, $crate::WithDisplay, $crate::WithDebugMultiline )
}}
}

Expand Down Expand Up @@ -178,7 +207,7 @@ mod private
)
=>
{{
$crate::_field_with_key!( $key, $src, $crate::WithRef, $crate::WithDisplay, $crate::WithDebug )
$crate::_field_with_key!( $src, $key, $crate::WithRef, $crate::WithDisplay, $crate::WithDebug )
}};
}

Expand All @@ -193,7 +222,7 @@ mod private
( $( $t:tt )+ )
=>
{{
$crate::_field!( $( $t )+, $crate::WithRef, $crate::WithDisplay, $crate::WithDebug )
$crate::_field!( ( $( $t )+ ), $crate::WithRef, $crate::WithDisplay, $crate::WithDebug )
}}
}

Expand Down Expand Up @@ -226,7 +255,7 @@ mod private
)
=>
{{
$crate::_field_with_key!( $key, $src, $crate::WithRef, $crate::WithDebug, $crate::WithDebug )
$crate::_field_with_key!( $src, $key, $crate::WithRef, $crate::WithDebug, $crate::WithDebug )
}};
}

Expand All @@ -240,7 +269,7 @@ mod private
( $( $t:tt )+ )
=>
{{
$crate::_field!( $( $t )+, $crate::WithRef, $crate::WithDebug, $crate::WithDebug )
$crate::_field!( ( $( $t )+ ), $crate::WithRef, $crate::WithDebug, $crate::WithDebug )
}}
}

Expand All @@ -261,6 +290,11 @@ pub mod table;
pub mod to_string;
pub mod to_string_with_fallback;

/// A strucutre for diagnostic and demonstration purpose.
#[ doc( hidden ) ]
#[ cfg( debug_assertions ) ]
pub mod test_object_without_impl;

#[ doc( inline ) ]
#[ allow( unused_imports ) ]
pub use own::*;
Expand Down Expand Up @@ -304,6 +338,14 @@ pub mod orphan
ref_or_debug,
};

#[ doc( hidden ) ]
#[ cfg( debug_assertions ) ]
pub use test_object_without_impl::
{
TestObjectWithoutImpl,
test_objects_gen,
};

}

/// Exposed namespace of the module.
Expand Down
Loading

0 comments on commit 4a090ae

Please sign in to comment.