From 256dd381ac5b3f608eb331b1ea3e66ef0b623808 Mon Sep 17 00:00:00 2001 From: wbot <69343704+wtools-bot@users.noreply.github.com> Date: Tue, 10 Sep 2024 17:45:14 +0300 Subject: [PATCH] AUTO : Forward from format_tools_evolving_4 to alpha (#1459) mod_interface : fix it and implement reuse --- Cargo.toml | 4 +- module/blank/mindx12/Cargo.toml | 34 +++ module/blank/mindx12/License | 22 ++ module/blank/mindx12/Readme.md | 33 +++ module/blank/mindx12/src/lib.rs | 10 + module/blank/mindx12/tests/inc/basic_test.rs | 7 + module/blank/mindx12/tests/inc/mod.rs | 4 + module/blank/mindx12/tests/smoke_test.rs | 14 ++ module/blank/mindx12/tests/tests.rs | 10 + module/blank/mingl/Cargo.toml | 34 +++ module/blank/mingl/License | 22 ++ module/blank/mingl/Readme.md | 33 +++ module/blank/mingl/src/lib.rs | 10 + module/blank/mingl/tests/inc/basic_test.rs | 7 + module/blank/mingl/tests/inc/mod.rs | 4 + module/blank/mingl/tests/smoke_test.rs | 14 ++ module/blank/mingl/tests/tests.rs | 10 + module/blank/minmetal/Cargo.toml | 34 +++ module/blank/minmetal/License | 22 ++ module/blank/minmetal/Readme.md | 33 +++ module/blank/minmetal/src/lib.rs | 10 + module/blank/minmetal/tests/inc/basic_test.rs | 7 + module/blank/minmetal/tests/inc/mod.rs | 4 + module/blank/minmetal/tests/smoke_test.rs | 14 ++ module/blank/minmetal/tests/tests.rs | 10 + module/blank/minopengl/Cargo.toml | 34 +++ module/blank/minopengl/License | 22 ++ module/blank/minopengl/Readme.md | 33 +++ module/blank/minopengl/src/lib.rs | 10 + .../blank/minopengl/tests/inc/basic_test.rs | 7 + module/blank/minopengl/tests/inc/mod.rs | 4 + module/blank/minopengl/tests/smoke_test.rs | 14 ++ module/blank/minopengl/tests/tests.rs | 10 + module/blank/minvulkan/Cargo.toml | 34 +++ module/blank/minvulkan/License | 22 ++ module/blank/minvulkan/Readme.md | 33 +++ module/blank/minvulkan/src/lib.rs | 10 + .../blank/minvulkan/tests/inc/basic_test.rs | 7 + module/blank/minvulkan/tests/inc/mod.rs | 4 + module/blank/minvulkan/tests/smoke_test.rs | 14 ++ module/blank/minvulkan/tests/tests.rs | 10 + module/blank/minwebgl/Cargo.toml | 34 +++ module/blank/minwebgl/License | 22 ++ module/blank/minwebgl/Readme.md | 33 +++ module/blank/minwebgl/src/lib.rs | 10 + module/blank/minwebgl/tests/inc/basic_test.rs | 7 + module/blank/minwebgl/tests/inc/mod.rs | 4 + module/blank/minwebgl/tests/smoke_test.rs | 14 ++ module/blank/minwebgl/tests/tests.rs | 10 + module/blank/minwebgpu/Cargo.toml | 34 +++ module/blank/minwebgpu/License | 22 ++ module/blank/minwebgpu/Readme.md | 33 +++ module/blank/minwebgpu/src/lib.rs | 10 + .../blank/minwebgpu/tests/inc/basic_test.rs | 7 + module/blank/minwebgpu/tests/inc/mod.rs | 4 + module/blank/minwebgpu/tests/smoke_test.rs | 14 ++ module/blank/minwebgpu/tests/tests.rs | 10 + module/blank/minwgpu/Cargo.toml | 34 +++ module/blank/minwgpu/License | 22 ++ module/blank/minwgpu/Readme.md | 33 +++ module/blank/minwgpu/src/lib.rs | 10 + module/blank/minwgpu/tests/inc/basic_test.rs | 7 + module/blank/minwgpu/tests/inc/mod.rs | 4 + module/blank/minwgpu/tests/smoke_test.rs | 14 ++ module/blank/minwgpu/tests/tests.rs | 10 + module/core/meta_tools/src/lib.rs | 3 + module/core/mod_interface/Cargo.toml | 2 +- module/core/mod_interface/Readme.md | 191 ++++++++++++----- .../examples/mod_interface_debug/Readme.md | 4 +- .../src/{inner.rs => child.rs} | 2 +- .../examples/mod_interface_debug/src/main.rs | 14 +- .../mod_interface_trivial/src/child.rs | 23 ++ .../mod_interface_trivial/src/inner.rs | 15 -- .../mod_interface_trivial/src/main.rs | 52 +++-- .../tests/inc/derive/attr_debug/mod.rs | 4 +- .../tests/inc/derive/micro_modules/mod.rs | 1 + .../{mod_protected.rs => mod_own.rs} | 0 .../micro_modules_glob/child.rs} | 0 .../inc/derive/micro_modules_glob/mod.rs | 28 +++ .../{mod_protected1.rs => mod_own1.rs} | 0 .../{mod_protected2.rs => mod_own2.rs} | 0 .../{mod_protected1.rs => mod_own1.rs} | 0 .../{mod_protected2.rs => mod_own2.rs} | 0 .../tests/inc/derive/reuse_basic/child.rs | 15 ++ .../tests/inc/derive/reuse_basic/mod.rs | 34 +++ .../tests/inc/derive/use_as/derive.rs | 4 +- .../tests/inc/derive/use_as/manual_only.rs | 2 +- .../tests/inc/derive/use_basic/mod.rs | 2 + .../tests/inc/derive/use_layer/mod.rs | 7 +- .../tests/inc/manual/micro_modules/mod_own.rs | 5 + .../{mod_protected1.rs => mod_own1.rs} | 0 .../{mod_protected2.rs => mod_own2.rs} | 0 module/core/mod_interface/tests/inc/mod.rs | 9 +- module/core/mod_interface_meta/Cargo.toml | 2 +- module/core/mod_interface_meta/src/impls.rs | 197 +++++++++++++----- module/core/mod_interface_meta/src/lib.rs | 3 +- module/core/mod_interface_meta/src/record.rs | 9 +- .../core/mod_interface_meta/src/use_tree.rs | 59 ++++-- module/core/process_tools/src/lib.rs | 2 + module/core/proper_path_tools/src/lib.rs | 2 + module/core/test_tools/src/lib.rs | 4 + .../core/test_tools/src/test/compiletime.rs | 62 ++++++ module/core/test_tools/src/test/helper.rs | 4 +- module/core/test_tools/src/test/mod.rs | 2 + module/move/wca/src/ca/executor/mod.rs | 2 + module/move/wca/src/ca/grammar/mod.rs | 2 + module/move/wca/src/ca/mod.rs | 2 + module/move/wca/src/ca/parser/mod.rs | 4 +- module/move/wca/src/ca/tool/mod.rs | 2 + module/move/wca/src/ca/verifier/mod.rs | 2 + module/move/wca/src/lib.rs | 2 + module/move/willbe/src/action/mod.rs | 2 + module/move/willbe/src/entity/mod.rs | 2 + module/move/willbe/src/tool/mod.rs | 2 + 114 files changed, 1689 insertions(+), 172 deletions(-) create mode 100644 module/blank/mindx12/Cargo.toml create mode 100644 module/blank/mindx12/License create mode 100644 module/blank/mindx12/Readme.md create mode 100644 module/blank/mindx12/src/lib.rs create mode 100644 module/blank/mindx12/tests/inc/basic_test.rs create mode 100644 module/blank/mindx12/tests/inc/mod.rs create mode 100644 module/blank/mindx12/tests/smoke_test.rs create mode 100644 module/blank/mindx12/tests/tests.rs create mode 100644 module/blank/mingl/Cargo.toml create mode 100644 module/blank/mingl/License create mode 100644 module/blank/mingl/Readme.md create mode 100644 module/blank/mingl/src/lib.rs create mode 100644 module/blank/mingl/tests/inc/basic_test.rs create mode 100644 module/blank/mingl/tests/inc/mod.rs create mode 100644 module/blank/mingl/tests/smoke_test.rs create mode 100644 module/blank/mingl/tests/tests.rs create mode 100644 module/blank/minmetal/Cargo.toml create mode 100644 module/blank/minmetal/License create mode 100644 module/blank/minmetal/Readme.md create mode 100644 module/blank/minmetal/src/lib.rs create mode 100644 module/blank/minmetal/tests/inc/basic_test.rs create mode 100644 module/blank/minmetal/tests/inc/mod.rs create mode 100644 module/blank/minmetal/tests/smoke_test.rs create mode 100644 module/blank/minmetal/tests/tests.rs create mode 100644 module/blank/minopengl/Cargo.toml create mode 100644 module/blank/minopengl/License create mode 100644 module/blank/minopengl/Readme.md create mode 100644 module/blank/minopengl/src/lib.rs create mode 100644 module/blank/minopengl/tests/inc/basic_test.rs create mode 100644 module/blank/minopengl/tests/inc/mod.rs create mode 100644 module/blank/minopengl/tests/smoke_test.rs create mode 100644 module/blank/minopengl/tests/tests.rs create mode 100644 module/blank/minvulkan/Cargo.toml create mode 100644 module/blank/minvulkan/License create mode 100644 module/blank/minvulkan/Readme.md create mode 100644 module/blank/minvulkan/src/lib.rs create mode 100644 module/blank/minvulkan/tests/inc/basic_test.rs create mode 100644 module/blank/minvulkan/tests/inc/mod.rs create mode 100644 module/blank/minvulkan/tests/smoke_test.rs create mode 100644 module/blank/minvulkan/tests/tests.rs create mode 100644 module/blank/minwebgl/Cargo.toml create mode 100644 module/blank/minwebgl/License create mode 100644 module/blank/minwebgl/Readme.md create mode 100644 module/blank/minwebgl/src/lib.rs create mode 100644 module/blank/minwebgl/tests/inc/basic_test.rs create mode 100644 module/blank/minwebgl/tests/inc/mod.rs create mode 100644 module/blank/minwebgl/tests/smoke_test.rs create mode 100644 module/blank/minwebgl/tests/tests.rs create mode 100644 module/blank/minwebgpu/Cargo.toml create mode 100644 module/blank/minwebgpu/License create mode 100644 module/blank/minwebgpu/Readme.md create mode 100644 module/blank/minwebgpu/src/lib.rs create mode 100644 module/blank/minwebgpu/tests/inc/basic_test.rs create mode 100644 module/blank/minwebgpu/tests/inc/mod.rs create mode 100644 module/blank/minwebgpu/tests/smoke_test.rs create mode 100644 module/blank/minwebgpu/tests/tests.rs create mode 100644 module/blank/minwgpu/Cargo.toml create mode 100644 module/blank/minwgpu/License create mode 100644 module/blank/minwgpu/Readme.md create mode 100644 module/blank/minwgpu/src/lib.rs create mode 100644 module/blank/minwgpu/tests/inc/basic_test.rs create mode 100644 module/blank/minwgpu/tests/inc/mod.rs create mode 100644 module/blank/minwgpu/tests/smoke_test.rs create mode 100644 module/blank/minwgpu/tests/tests.rs rename module/core/mod_interface/examples/mod_interface_debug/src/{inner.rs => child.rs} (80%) create mode 100644 module/core/mod_interface/examples/mod_interface_trivial/src/child.rs delete mode 100644 module/core/mod_interface/examples/mod_interface_trivial/src/inner.rs rename module/core/mod_interface/tests/inc/derive/micro_modules/{mod_protected.rs => mod_own.rs} (100%) rename module/core/mod_interface/tests/inc/{manual/micro_modules/mod_protected.rs => derive/micro_modules_glob/child.rs} (100%) create mode 100644 module/core/mod_interface/tests/inc/derive/micro_modules_glob/mod.rs rename module/core/mod_interface/tests/inc/derive/micro_modules_two/{mod_protected1.rs => mod_own1.rs} (100%) rename module/core/mod_interface/tests/inc/derive/micro_modules_two/{mod_protected2.rs => mod_own2.rs} (100%) rename module/core/mod_interface/tests/inc/derive/micro_modules_two_joined/{mod_protected1.rs => mod_own1.rs} (100%) rename module/core/mod_interface/tests/inc/derive/micro_modules_two_joined/{mod_protected2.rs => mod_own2.rs} (100%) create mode 100644 module/core/mod_interface/tests/inc/derive/reuse_basic/child.rs create mode 100644 module/core/mod_interface/tests/inc/derive/reuse_basic/mod.rs create mode 100644 module/core/mod_interface/tests/inc/manual/micro_modules/mod_own.rs rename module/core/mod_interface/tests/inc/manual/micro_modules_two/{mod_protected1.rs => mod_own1.rs} (100%) rename module/core/mod_interface/tests/inc/manual/micro_modules_two/{mod_protected2.rs => mod_own2.rs} (100%) diff --git a/Cargo.toml b/Cargo.toml index 7881396f5f..00ffdb5cdf 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -248,12 +248,12 @@ version = "~0.7.0" path = "module/core/impls_index_meta" [workspace.dependencies.mod_interface] -version = "~0.24.0" +version = "~0.25.0" path = "module/core/mod_interface" default-features = false [workspace.dependencies.mod_interface_meta] -version = "~0.24.0" +version = "~0.25.0" path = "module/core/mod_interface_meta" default-features = false diff --git a/module/blank/mindx12/Cargo.toml b/module/blank/mindx12/Cargo.toml new file mode 100644 index 0000000000..a26d724817 --- /dev/null +++ b/module/blank/mindx12/Cargo.toml @@ -0,0 +1,34 @@ +[package] +name = "mindx12" +version = "0.1.0" +edition = "2021" +authors = [ + "Kostiantyn Wandalen ", +] +license = "MIT" +readme = "Readme.md" +documentation = "https://docs.rs/mindx12" +repository = "https://github.com/Wandalen/wTools/tree/master/module/core/mindx12" +homepage = "https://github.com/Wandalen/wTools/tree/master/module/core/mindx12" +description = """ +Draw language. +""" +categories = [ "algorithms", "development-tools" ] +keywords = [ "fundamental", "general-purpose" ] + +[lints] +workspace = true + +[package.metadata.docs.rs] +features = [ "full" ] +all-features = false + +[features] +default = [ "enabled" ] +full = [ "enabled" ] +enabled = [] + +[dependencies] + +[dev-dependencies] +test_tools = { workspace = true } diff --git a/module/blank/mindx12/License b/module/blank/mindx12/License new file mode 100644 index 0000000000..6d5ef8559f --- /dev/null +++ b/module/blank/mindx12/License @@ -0,0 +1,22 @@ +Copyright Kostiantyn W and Out of the Box Systems (c) 2013-2024 + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/module/blank/mindx12/Readme.md b/module/blank/mindx12/Readme.md new file mode 100644 index 0000000000..adc110369e --- /dev/null +++ b/module/blank/mindx12/Readme.md @@ -0,0 +1,33 @@ + + +# Module :: mindx12 +[![experimental](https://raster.shields.io/static/v1?label=stability&message=experimental&color=orange&logoColor=eee)](https://github.com/emersion/stability-badges#experimental) [![rust-status](https://github.com/Wandalen/wTools/actions/workflows/Modulemindx12Push.yml/badge.svg)](https://github.com/Wandalen/wTools/actions/workflows/Modulemindx12Push.yml) [![docs.rs](https://img.shields.io/docsrs/mindx12?color=e3e8f0&logo=docs.rs)](https://docs.rs/mindx12) [![discord](https://img.shields.io/discord/872391416519737405?color=eee&logo=discord&logoColor=eee&label=ask)](https://discord.gg/m3YfbXpUUY) + +Draw language. + + diff --git a/module/blank/mindx12/src/lib.rs b/module/blank/mindx12/src/lib.rs new file mode 100644 index 0000000000..8736456366 --- /dev/null +++ b/module/blank/mindx12/src/lib.rs @@ -0,0 +1,10 @@ + +#![ doc( html_logo_url = "https://raw.githubusercontent.com/Wandalen/wTools/master/asset/img/logo_v3_trans_square.png" ) ] +#![ doc( html_favicon_url = "https://raw.githubusercontent.com/Wandalen/wTools/alpha/asset/img/logo_v3_trans_square_icon_small_v2.ico" ) ] +#![ doc = include_str!( concat!( env!( "CARGO_MANIFEST_DIR" ), "/", "Readme.md" ) ) ] + +/// Function description. +#[ cfg( feature = "enabled" ) ] +pub fn f1() +{ +} diff --git a/module/blank/mindx12/tests/inc/basic_test.rs b/module/blank/mindx12/tests/inc/basic_test.rs new file mode 100644 index 0000000000..60c9a81cfb --- /dev/null +++ b/module/blank/mindx12/tests/inc/basic_test.rs @@ -0,0 +1,7 @@ +#[ allow( unused_imports ) ] +use super::*; + +#[ test ] +fn basic() +{ +} diff --git a/module/blank/mindx12/tests/inc/mod.rs b/module/blank/mindx12/tests/inc/mod.rs new file mode 100644 index 0000000000..dde9de6f94 --- /dev/null +++ b/module/blank/mindx12/tests/inc/mod.rs @@ -0,0 +1,4 @@ +#[ allow( unused_imports ) ] +use super::*; + +mod basic_test; diff --git a/module/blank/mindx12/tests/smoke_test.rs b/module/blank/mindx12/tests/smoke_test.rs new file mode 100644 index 0000000000..828e9b016b --- /dev/null +++ b/module/blank/mindx12/tests/smoke_test.rs @@ -0,0 +1,14 @@ + + +#[ test ] +fn local_smoke_test() +{ + ::test_tools::smoke_test_for_local_run(); +} + + +#[ test ] +fn published_smoke_test() +{ + ::test_tools::smoke_test_for_published_run(); +} diff --git a/module/blank/mindx12/tests/tests.rs b/module/blank/mindx12/tests/tests.rs new file mode 100644 index 0000000000..5a33e742f0 --- /dev/null +++ b/module/blank/mindx12/tests/tests.rs @@ -0,0 +1,10 @@ + +include!( "../../../../module/step/meta/src/module/terminal.rs" ); + +#[ allow( unused_imports ) ] +use mindx12 as the_module; +#[ allow( unused_imports ) ] +use test_tools::exposed::*; + +#[ cfg( feature = "enabled" ) ] +mod inc; diff --git a/module/blank/mingl/Cargo.toml b/module/blank/mingl/Cargo.toml new file mode 100644 index 0000000000..dbd89af97e --- /dev/null +++ b/module/blank/mingl/Cargo.toml @@ -0,0 +1,34 @@ +[package] +name = "mingl" +version = "0.1.0" +edition = "2021" +authors = [ + "Kostiantyn Wandalen ", +] +license = "MIT" +readme = "Readme.md" +documentation = "https://docs.rs/mingl" +repository = "https://github.com/Wandalen/wTools/tree/master/module/core/mingl" +homepage = "https://github.com/Wandalen/wTools/tree/master/module/core/mingl" +description = """ +Draw language. +""" +categories = [ "algorithms", "development-tools" ] +keywords = [ "fundamental", "general-purpose" ] + +[lints] +workspace = true + +[package.metadata.docs.rs] +features = [ "full" ] +all-features = false + +[features] +default = [ "enabled" ] +full = [ "enabled" ] +enabled = [] + +[dependencies] + +[dev-dependencies] +test_tools = { workspace = true } diff --git a/module/blank/mingl/License b/module/blank/mingl/License new file mode 100644 index 0000000000..6d5ef8559f --- /dev/null +++ b/module/blank/mingl/License @@ -0,0 +1,22 @@ +Copyright Kostiantyn W and Out of the Box Systems (c) 2013-2024 + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/module/blank/mingl/Readme.md b/module/blank/mingl/Readme.md new file mode 100644 index 0000000000..3a3390cd6c --- /dev/null +++ b/module/blank/mingl/Readme.md @@ -0,0 +1,33 @@ + + +# Module :: draw_lang +[![experimental](https://raster.shields.io/static/v1?label=stability&message=experimental&color=orange&logoColor=eee)](https://github.com/emersion/stability-badges#experimental) [![rust-status](https://github.com/Wandalen/wTools/actions/workflows/Moduledraw_langPush.yml/badge.svg)](https://github.com/Wandalen/wTools/actions/workflows/Moduledraw_langPush.yml) [![docs.rs](https://img.shields.io/docsrs/draw_lang?color=e3e8f0&logo=docs.rs)](https://docs.rs/draw_lang) [![discord](https://img.shields.io/discord/872391416519737405?color=eee&logo=discord&logoColor=eee&label=ask)](https://discord.gg/m3YfbXpUUY) + +Draw language. + + diff --git a/module/blank/mingl/src/lib.rs b/module/blank/mingl/src/lib.rs new file mode 100644 index 0000000000..8736456366 --- /dev/null +++ b/module/blank/mingl/src/lib.rs @@ -0,0 +1,10 @@ + +#![ doc( html_logo_url = "https://raw.githubusercontent.com/Wandalen/wTools/master/asset/img/logo_v3_trans_square.png" ) ] +#![ doc( html_favicon_url = "https://raw.githubusercontent.com/Wandalen/wTools/alpha/asset/img/logo_v3_trans_square_icon_small_v2.ico" ) ] +#![ doc = include_str!( concat!( env!( "CARGO_MANIFEST_DIR" ), "/", "Readme.md" ) ) ] + +/// Function description. +#[ cfg( feature = "enabled" ) ] +pub fn f1() +{ +} diff --git a/module/blank/mingl/tests/inc/basic_test.rs b/module/blank/mingl/tests/inc/basic_test.rs new file mode 100644 index 0000000000..60c9a81cfb --- /dev/null +++ b/module/blank/mingl/tests/inc/basic_test.rs @@ -0,0 +1,7 @@ +#[ allow( unused_imports ) ] +use super::*; + +#[ test ] +fn basic() +{ +} diff --git a/module/blank/mingl/tests/inc/mod.rs b/module/blank/mingl/tests/inc/mod.rs new file mode 100644 index 0000000000..dde9de6f94 --- /dev/null +++ b/module/blank/mingl/tests/inc/mod.rs @@ -0,0 +1,4 @@ +#[ allow( unused_imports ) ] +use super::*; + +mod basic_test; diff --git a/module/blank/mingl/tests/smoke_test.rs b/module/blank/mingl/tests/smoke_test.rs new file mode 100644 index 0000000000..828e9b016b --- /dev/null +++ b/module/blank/mingl/tests/smoke_test.rs @@ -0,0 +1,14 @@ + + +#[ test ] +fn local_smoke_test() +{ + ::test_tools::smoke_test_for_local_run(); +} + + +#[ test ] +fn published_smoke_test() +{ + ::test_tools::smoke_test_for_published_run(); +} diff --git a/module/blank/mingl/tests/tests.rs b/module/blank/mingl/tests/tests.rs new file mode 100644 index 0000000000..3e3cefe2bd --- /dev/null +++ b/module/blank/mingl/tests/tests.rs @@ -0,0 +1,10 @@ + +include!( "../../../../module/step/meta/src/module/terminal.rs" ); + +#[ allow( unused_imports ) ] +use mingl as the_module; +#[ allow( unused_imports ) ] +use test_tools::exposed::*; + +#[ cfg( feature = "enabled" ) ] +mod inc; diff --git a/module/blank/minmetal/Cargo.toml b/module/blank/minmetal/Cargo.toml new file mode 100644 index 0000000000..72527fb754 --- /dev/null +++ b/module/blank/minmetal/Cargo.toml @@ -0,0 +1,34 @@ +[package] +name = "minmetal" +version = "0.1.0" +edition = "2021" +authors = [ + "Kostiantyn Wandalen ", +] +license = "MIT" +readme = "Readme.md" +documentation = "https://docs.rs/minmetal" +repository = "https://github.com/Wandalen/wTools/tree/master/module/core/minmetal" +homepage = "https://github.com/Wandalen/wTools/tree/master/module/core/minmetal" +description = """ +Draw language. +""" +categories = [ "algorithms", "development-tools" ] +keywords = [ "fundamental", "general-purpose" ] + +[lints] +workspace = true + +[package.metadata.docs.rs] +features = [ "full" ] +all-features = false + +[features] +default = [ "enabled" ] +full = [ "enabled" ] +enabled = [] + +[dependencies] + +[dev-dependencies] +test_tools = { workspace = true } diff --git a/module/blank/minmetal/License b/module/blank/minmetal/License new file mode 100644 index 0000000000..6d5ef8559f --- /dev/null +++ b/module/blank/minmetal/License @@ -0,0 +1,22 @@ +Copyright Kostiantyn W and Out of the Box Systems (c) 2013-2024 + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/module/blank/minmetal/Readme.md b/module/blank/minmetal/Readme.md new file mode 100644 index 0000000000..f701fbedf7 --- /dev/null +++ b/module/blank/minmetal/Readme.md @@ -0,0 +1,33 @@ + + +# Module :: minmetal +[![experimental](https://raster.shields.io/static/v1?label=stability&message=experimental&color=orange&logoColor=eee)](https://github.com/emersion/stability-badges#experimental) [![rust-status](https://github.com/Wandalen/wTools/actions/workflows/ModuleminmetalPush.yml/badge.svg)](https://github.com/Wandalen/wTools/actions/workflows/ModuleminmetalPush.yml) [![docs.rs](https://img.shields.io/docsrs/minmetal?color=e3e8f0&logo=docs.rs)](https://docs.rs/minmetal) [![discord](https://img.shields.io/discord/872391416519737405?color=eee&logo=discord&logoColor=eee&label=ask)](https://discord.gg/m3YfbXpUUY) + +Draw language. + + diff --git a/module/blank/minmetal/src/lib.rs b/module/blank/minmetal/src/lib.rs new file mode 100644 index 0000000000..8736456366 --- /dev/null +++ b/module/blank/minmetal/src/lib.rs @@ -0,0 +1,10 @@ + +#![ doc( html_logo_url = "https://raw.githubusercontent.com/Wandalen/wTools/master/asset/img/logo_v3_trans_square.png" ) ] +#![ doc( html_favicon_url = "https://raw.githubusercontent.com/Wandalen/wTools/alpha/asset/img/logo_v3_trans_square_icon_small_v2.ico" ) ] +#![ doc = include_str!( concat!( env!( "CARGO_MANIFEST_DIR" ), "/", "Readme.md" ) ) ] + +/// Function description. +#[ cfg( feature = "enabled" ) ] +pub fn f1() +{ +} diff --git a/module/blank/minmetal/tests/inc/basic_test.rs b/module/blank/minmetal/tests/inc/basic_test.rs new file mode 100644 index 0000000000..60c9a81cfb --- /dev/null +++ b/module/blank/minmetal/tests/inc/basic_test.rs @@ -0,0 +1,7 @@ +#[ allow( unused_imports ) ] +use super::*; + +#[ test ] +fn basic() +{ +} diff --git a/module/blank/minmetal/tests/inc/mod.rs b/module/blank/minmetal/tests/inc/mod.rs new file mode 100644 index 0000000000..dde9de6f94 --- /dev/null +++ b/module/blank/minmetal/tests/inc/mod.rs @@ -0,0 +1,4 @@ +#[ allow( unused_imports ) ] +use super::*; + +mod basic_test; diff --git a/module/blank/minmetal/tests/smoke_test.rs b/module/blank/minmetal/tests/smoke_test.rs new file mode 100644 index 0000000000..828e9b016b --- /dev/null +++ b/module/blank/minmetal/tests/smoke_test.rs @@ -0,0 +1,14 @@ + + +#[ test ] +fn local_smoke_test() +{ + ::test_tools::smoke_test_for_local_run(); +} + + +#[ test ] +fn published_smoke_test() +{ + ::test_tools::smoke_test_for_published_run(); +} diff --git a/module/blank/minmetal/tests/tests.rs b/module/blank/minmetal/tests/tests.rs new file mode 100644 index 0000000000..f2f68bee4f --- /dev/null +++ b/module/blank/minmetal/tests/tests.rs @@ -0,0 +1,10 @@ + +include!( "../../../../module/step/meta/src/module/terminal.rs" ); + +#[ allow( unused_imports ) ] +use minmetal as the_module; +#[ allow( unused_imports ) ] +use test_tools::exposed::*; + +#[ cfg( feature = "enabled" ) ] +mod inc; diff --git a/module/blank/minopengl/Cargo.toml b/module/blank/minopengl/Cargo.toml new file mode 100644 index 0000000000..8be8629874 --- /dev/null +++ b/module/blank/minopengl/Cargo.toml @@ -0,0 +1,34 @@ +[package] +name = "minopengl" +version = "0.1.0" +edition = "2021" +authors = [ + "Kostiantyn Wandalen ", +] +license = "MIT" +readme = "Readme.md" +documentation = "https://docs.rs/minopengl" +repository = "https://github.com/Wandalen/wTools/tree/master/module/core/minopengl" +homepage = "https://github.com/Wandalen/wTools/tree/master/module/core/minopengl" +description = """ +Draw language. +""" +categories = [ "algorithms", "development-tools" ] +keywords = [ "fundamental", "general-purpose" ] + +[lints] +workspace = true + +[package.metadata.docs.rs] +features = [ "full" ] +all-features = false + +[features] +default = [ "enabled" ] +full = [ "enabled" ] +enabled = [] + +[dependencies] + +[dev-dependencies] +test_tools = { workspace = true } diff --git a/module/blank/minopengl/License b/module/blank/minopengl/License new file mode 100644 index 0000000000..6d5ef8559f --- /dev/null +++ b/module/blank/minopengl/License @@ -0,0 +1,22 @@ +Copyright Kostiantyn W and Out of the Box Systems (c) 2013-2024 + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/module/blank/minopengl/Readme.md b/module/blank/minopengl/Readme.md new file mode 100644 index 0000000000..7d19f733ea --- /dev/null +++ b/module/blank/minopengl/Readme.md @@ -0,0 +1,33 @@ + + +# Module :: minopengl +[![experimental](https://raster.shields.io/static/v1?label=stability&message=experimental&color=orange&logoColor=eee)](https://github.com/emersion/stability-badges#experimental) [![rust-status](https://github.com/Wandalen/wTools/actions/workflows/ModuleminopenglPush.yml/badge.svg)](https://github.com/Wandalen/wTools/actions/workflows/ModuleminopenglPush.yml) [![docs.rs](https://img.shields.io/docsrs/minopengl?color=e3e8f0&logo=docs.rs)](https://docs.rs/minopengl) [![discord](https://img.shields.io/discord/872391416519737405?color=eee&logo=discord&logoColor=eee&label=ask)](https://discord.gg/m3YfbXpUUY) + +Draw language. + + diff --git a/module/blank/minopengl/src/lib.rs b/module/blank/minopengl/src/lib.rs new file mode 100644 index 0000000000..8736456366 --- /dev/null +++ b/module/blank/minopengl/src/lib.rs @@ -0,0 +1,10 @@ + +#![ doc( html_logo_url = "https://raw.githubusercontent.com/Wandalen/wTools/master/asset/img/logo_v3_trans_square.png" ) ] +#![ doc( html_favicon_url = "https://raw.githubusercontent.com/Wandalen/wTools/alpha/asset/img/logo_v3_trans_square_icon_small_v2.ico" ) ] +#![ doc = include_str!( concat!( env!( "CARGO_MANIFEST_DIR" ), "/", "Readme.md" ) ) ] + +/// Function description. +#[ cfg( feature = "enabled" ) ] +pub fn f1() +{ +} diff --git a/module/blank/minopengl/tests/inc/basic_test.rs b/module/blank/minopengl/tests/inc/basic_test.rs new file mode 100644 index 0000000000..60c9a81cfb --- /dev/null +++ b/module/blank/minopengl/tests/inc/basic_test.rs @@ -0,0 +1,7 @@ +#[ allow( unused_imports ) ] +use super::*; + +#[ test ] +fn basic() +{ +} diff --git a/module/blank/minopengl/tests/inc/mod.rs b/module/blank/minopengl/tests/inc/mod.rs new file mode 100644 index 0000000000..dde9de6f94 --- /dev/null +++ b/module/blank/minopengl/tests/inc/mod.rs @@ -0,0 +1,4 @@ +#[ allow( unused_imports ) ] +use super::*; + +mod basic_test; diff --git a/module/blank/minopengl/tests/smoke_test.rs b/module/blank/minopengl/tests/smoke_test.rs new file mode 100644 index 0000000000..828e9b016b --- /dev/null +++ b/module/blank/minopengl/tests/smoke_test.rs @@ -0,0 +1,14 @@ + + +#[ test ] +fn local_smoke_test() +{ + ::test_tools::smoke_test_for_local_run(); +} + + +#[ test ] +fn published_smoke_test() +{ + ::test_tools::smoke_test_for_published_run(); +} diff --git a/module/blank/minopengl/tests/tests.rs b/module/blank/minopengl/tests/tests.rs new file mode 100644 index 0000000000..8a64879a19 --- /dev/null +++ b/module/blank/minopengl/tests/tests.rs @@ -0,0 +1,10 @@ + +include!( "../../../../module/step/meta/src/module/terminal.rs" ); + +#[ allow( unused_imports ) ] +use minopengl as the_module; +#[ allow( unused_imports ) ] +use test_tools::exposed::*; + +#[ cfg( feature = "enabled" ) ] +mod inc; diff --git a/module/blank/minvulkan/Cargo.toml b/module/blank/minvulkan/Cargo.toml new file mode 100644 index 0000000000..69ce9bda5d --- /dev/null +++ b/module/blank/minvulkan/Cargo.toml @@ -0,0 +1,34 @@ +[package] +name = "minvulkan" +version = "0.1.0" +edition = "2021" +authors = [ + "Kostiantyn Wandalen ", +] +license = "MIT" +readme = "Readme.md" +documentation = "https://docs.rs/minvulkan" +repository = "https://github.com/Wandalen/wTools/tree/master/module/core/minvulkan" +homepage = "https://github.com/Wandalen/wTools/tree/master/module/core/minvulkan" +description = """ +Draw language. +""" +categories = [ "algorithms", "development-tools" ] +keywords = [ "fundamental", "general-purpose" ] + +[lints] +workspace = true + +[package.metadata.docs.rs] +features = [ "full" ] +all-features = false + +[features] +default = [ "enabled" ] +full = [ "enabled" ] +enabled = [] + +[dependencies] + +[dev-dependencies] +test_tools = { workspace = true } diff --git a/module/blank/minvulkan/License b/module/blank/minvulkan/License new file mode 100644 index 0000000000..6d5ef8559f --- /dev/null +++ b/module/blank/minvulkan/License @@ -0,0 +1,22 @@ +Copyright Kostiantyn W and Out of the Box Systems (c) 2013-2024 + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/module/blank/minvulkan/Readme.md b/module/blank/minvulkan/Readme.md new file mode 100644 index 0000000000..69b19ad55c --- /dev/null +++ b/module/blank/minvulkan/Readme.md @@ -0,0 +1,33 @@ + + +# Module :: minvulkan +[![experimental](https://raster.shields.io/static/v1?label=stability&message=experimental&color=orange&logoColor=eee)](https://github.com/emersion/stability-badges#experimental) [![rust-status](https://github.com/Wandalen/wTools/actions/workflows/ModuleminvulkanPush.yml/badge.svg)](https://github.com/Wandalen/wTools/actions/workflows/ModuleminvulkanPush.yml) [![docs.rs](https://img.shields.io/docsrs/minvulkan?color=e3e8f0&logo=docs.rs)](https://docs.rs/minvulkan) [![discord](https://img.shields.io/discord/872391416519737405?color=eee&logo=discord&logoColor=eee&label=ask)](https://discord.gg/m3YfbXpUUY) + +Draw language. + + diff --git a/module/blank/minvulkan/src/lib.rs b/module/blank/minvulkan/src/lib.rs new file mode 100644 index 0000000000..8736456366 --- /dev/null +++ b/module/blank/minvulkan/src/lib.rs @@ -0,0 +1,10 @@ + +#![ doc( html_logo_url = "https://raw.githubusercontent.com/Wandalen/wTools/master/asset/img/logo_v3_trans_square.png" ) ] +#![ doc( html_favicon_url = "https://raw.githubusercontent.com/Wandalen/wTools/alpha/asset/img/logo_v3_trans_square_icon_small_v2.ico" ) ] +#![ doc = include_str!( concat!( env!( "CARGO_MANIFEST_DIR" ), "/", "Readme.md" ) ) ] + +/// Function description. +#[ cfg( feature = "enabled" ) ] +pub fn f1() +{ +} diff --git a/module/blank/minvulkan/tests/inc/basic_test.rs b/module/blank/minvulkan/tests/inc/basic_test.rs new file mode 100644 index 0000000000..60c9a81cfb --- /dev/null +++ b/module/blank/minvulkan/tests/inc/basic_test.rs @@ -0,0 +1,7 @@ +#[ allow( unused_imports ) ] +use super::*; + +#[ test ] +fn basic() +{ +} diff --git a/module/blank/minvulkan/tests/inc/mod.rs b/module/blank/minvulkan/tests/inc/mod.rs new file mode 100644 index 0000000000..dde9de6f94 --- /dev/null +++ b/module/blank/minvulkan/tests/inc/mod.rs @@ -0,0 +1,4 @@ +#[ allow( unused_imports ) ] +use super::*; + +mod basic_test; diff --git a/module/blank/minvulkan/tests/smoke_test.rs b/module/blank/minvulkan/tests/smoke_test.rs new file mode 100644 index 0000000000..828e9b016b --- /dev/null +++ b/module/blank/minvulkan/tests/smoke_test.rs @@ -0,0 +1,14 @@ + + +#[ test ] +fn local_smoke_test() +{ + ::test_tools::smoke_test_for_local_run(); +} + + +#[ test ] +fn published_smoke_test() +{ + ::test_tools::smoke_test_for_published_run(); +} diff --git a/module/blank/minvulkan/tests/tests.rs b/module/blank/minvulkan/tests/tests.rs new file mode 100644 index 0000000000..d2d5f19233 --- /dev/null +++ b/module/blank/minvulkan/tests/tests.rs @@ -0,0 +1,10 @@ + +include!( "../../../../module/step/meta/src/module/terminal.rs" ); + +#[ allow( unused_imports ) ] +use minvulkan as the_module; +#[ allow( unused_imports ) ] +use test_tools::exposed::*; + +#[ cfg( feature = "enabled" ) ] +mod inc; diff --git a/module/blank/minwebgl/Cargo.toml b/module/blank/minwebgl/Cargo.toml new file mode 100644 index 0000000000..06d52581fb --- /dev/null +++ b/module/blank/minwebgl/Cargo.toml @@ -0,0 +1,34 @@ +[package] +name = "minwebgl" +version = "0.1.0" +edition = "2021" +authors = [ + "Kostiantyn Wandalen ", +] +license = "MIT" +readme = "Readme.md" +documentation = "https://docs.rs/minwebgl" +repository = "https://github.com/Wandalen/wTools/tree/master/module/core/minwebgl" +homepage = "https://github.com/Wandalen/wTools/tree/master/module/core/minwebgl" +description = """ +Draw language. +""" +categories = [ "algorithms", "development-tools" ] +keywords = [ "fundamental", "general-purpose" ] + +[lints] +workspace = true + +[package.metadata.docs.rs] +features = [ "full" ] +all-features = false + +[features] +default = [ "enabled" ] +full = [ "enabled" ] +enabled = [] + +[dependencies] + +[dev-dependencies] +test_tools = { workspace = true } diff --git a/module/blank/minwebgl/License b/module/blank/minwebgl/License new file mode 100644 index 0000000000..6d5ef8559f --- /dev/null +++ b/module/blank/minwebgl/License @@ -0,0 +1,22 @@ +Copyright Kostiantyn W and Out of the Box Systems (c) 2013-2024 + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/module/blank/minwebgl/Readme.md b/module/blank/minwebgl/Readme.md new file mode 100644 index 0000000000..5b92138916 --- /dev/null +++ b/module/blank/minwebgl/Readme.md @@ -0,0 +1,33 @@ + + +# Module :: minwebgl +[![experimental](https://raster.shields.io/static/v1?label=stability&message=experimental&color=orange&logoColor=eee)](https://github.com/emersion/stability-badges#experimental) [![rust-status](https://github.com/Wandalen/wTools/actions/workflows/ModuleminwebglPush.yml/badge.svg)](https://github.com/Wandalen/wTools/actions/workflows/ModuleminwebglPush.yml) [![docs.rs](https://img.shields.io/docsrs/minwebgl?color=e3e8f0&logo=docs.rs)](https://docs.rs/minwebgl) [![discord](https://img.shields.io/discord/872391416519737405?color=eee&logo=discord&logoColor=eee&label=ask)](https://discord.gg/m3YfbXpUUY) + +Draw language. + + diff --git a/module/blank/minwebgl/src/lib.rs b/module/blank/minwebgl/src/lib.rs new file mode 100644 index 0000000000..8736456366 --- /dev/null +++ b/module/blank/minwebgl/src/lib.rs @@ -0,0 +1,10 @@ + +#![ doc( html_logo_url = "https://raw.githubusercontent.com/Wandalen/wTools/master/asset/img/logo_v3_trans_square.png" ) ] +#![ doc( html_favicon_url = "https://raw.githubusercontent.com/Wandalen/wTools/alpha/asset/img/logo_v3_trans_square_icon_small_v2.ico" ) ] +#![ doc = include_str!( concat!( env!( "CARGO_MANIFEST_DIR" ), "/", "Readme.md" ) ) ] + +/// Function description. +#[ cfg( feature = "enabled" ) ] +pub fn f1() +{ +} diff --git a/module/blank/minwebgl/tests/inc/basic_test.rs b/module/blank/minwebgl/tests/inc/basic_test.rs new file mode 100644 index 0000000000..60c9a81cfb --- /dev/null +++ b/module/blank/minwebgl/tests/inc/basic_test.rs @@ -0,0 +1,7 @@ +#[ allow( unused_imports ) ] +use super::*; + +#[ test ] +fn basic() +{ +} diff --git a/module/blank/minwebgl/tests/inc/mod.rs b/module/blank/minwebgl/tests/inc/mod.rs new file mode 100644 index 0000000000..dde9de6f94 --- /dev/null +++ b/module/blank/minwebgl/tests/inc/mod.rs @@ -0,0 +1,4 @@ +#[ allow( unused_imports ) ] +use super::*; + +mod basic_test; diff --git a/module/blank/minwebgl/tests/smoke_test.rs b/module/blank/minwebgl/tests/smoke_test.rs new file mode 100644 index 0000000000..828e9b016b --- /dev/null +++ b/module/blank/minwebgl/tests/smoke_test.rs @@ -0,0 +1,14 @@ + + +#[ test ] +fn local_smoke_test() +{ + ::test_tools::smoke_test_for_local_run(); +} + + +#[ test ] +fn published_smoke_test() +{ + ::test_tools::smoke_test_for_published_run(); +} diff --git a/module/blank/minwebgl/tests/tests.rs b/module/blank/minwebgl/tests/tests.rs new file mode 100644 index 0000000000..f830fcaa61 --- /dev/null +++ b/module/blank/minwebgl/tests/tests.rs @@ -0,0 +1,10 @@ + +include!( "../../../../module/step/meta/src/module/terminal.rs" ); + +#[ allow( unused_imports ) ] +use minwebgl as the_module; +#[ allow( unused_imports ) ] +use test_tools::exposed::*; + +#[ cfg( feature = "enabled" ) ] +mod inc; diff --git a/module/blank/minwebgpu/Cargo.toml b/module/blank/minwebgpu/Cargo.toml new file mode 100644 index 0000000000..c543c5be36 --- /dev/null +++ b/module/blank/minwebgpu/Cargo.toml @@ -0,0 +1,34 @@ +[package] +name = "minwebgpu" +version = "0.1.0" +edition = "2021" +authors = [ + "Kostiantyn Wandalen ", +] +license = "MIT" +readme = "Readme.md" +documentation = "https://docs.rs/minwebgpu" +repository = "https://github.com/Wandalen/wTools/tree/master/module/core/minwebgpu" +homepage = "https://github.com/Wandalen/wTools/tree/master/module/core/minwebgpu" +description = """ +Draw language. +""" +categories = [ "algorithms", "development-tools" ] +keywords = [ "fundamental", "general-purpose" ] + +[lints] +workspace = true + +[package.metadata.docs.rs] +features = [ "full" ] +all-features = false + +[features] +default = [ "enabled" ] +full = [ "enabled" ] +enabled = [] + +[dependencies] + +[dev-dependencies] +test_tools = { workspace = true } diff --git a/module/blank/minwebgpu/License b/module/blank/minwebgpu/License new file mode 100644 index 0000000000..6d5ef8559f --- /dev/null +++ b/module/blank/minwebgpu/License @@ -0,0 +1,22 @@ +Copyright Kostiantyn W and Out of the Box Systems (c) 2013-2024 + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/module/blank/minwebgpu/Readme.md b/module/blank/minwebgpu/Readme.md new file mode 100644 index 0000000000..259dee0ab2 --- /dev/null +++ b/module/blank/minwebgpu/Readme.md @@ -0,0 +1,33 @@ + + +# Module :: minwebgpu +[![experimental](https://raster.shields.io/static/v1?label=stability&message=experimental&color=orange&logoColor=eee)](https://github.com/emersion/stability-badges#experimental) [![rust-status](https://github.com/Wandalen/wTools/actions/workflows/ModuleminwebgpuPush.yml/badge.svg)](https://github.com/Wandalen/wTools/actions/workflows/ModuleminwebgpuPush.yml) [![docs.rs](https://img.shields.io/docsrs/minwebgpu?color=e3e8f0&logo=docs.rs)](https://docs.rs/minwebgpu) [![discord](https://img.shields.io/discord/872391416519737405?color=eee&logo=discord&logoColor=eee&label=ask)](https://discord.gg/m3YfbXpUUY) + +Draw language. + + diff --git a/module/blank/minwebgpu/src/lib.rs b/module/blank/minwebgpu/src/lib.rs new file mode 100644 index 0000000000..8736456366 --- /dev/null +++ b/module/blank/minwebgpu/src/lib.rs @@ -0,0 +1,10 @@ + +#![ doc( html_logo_url = "https://raw.githubusercontent.com/Wandalen/wTools/master/asset/img/logo_v3_trans_square.png" ) ] +#![ doc( html_favicon_url = "https://raw.githubusercontent.com/Wandalen/wTools/alpha/asset/img/logo_v3_trans_square_icon_small_v2.ico" ) ] +#![ doc = include_str!( concat!( env!( "CARGO_MANIFEST_DIR" ), "/", "Readme.md" ) ) ] + +/// Function description. +#[ cfg( feature = "enabled" ) ] +pub fn f1() +{ +} diff --git a/module/blank/minwebgpu/tests/inc/basic_test.rs b/module/blank/minwebgpu/tests/inc/basic_test.rs new file mode 100644 index 0000000000..60c9a81cfb --- /dev/null +++ b/module/blank/minwebgpu/tests/inc/basic_test.rs @@ -0,0 +1,7 @@ +#[ allow( unused_imports ) ] +use super::*; + +#[ test ] +fn basic() +{ +} diff --git a/module/blank/minwebgpu/tests/inc/mod.rs b/module/blank/minwebgpu/tests/inc/mod.rs new file mode 100644 index 0000000000..dde9de6f94 --- /dev/null +++ b/module/blank/minwebgpu/tests/inc/mod.rs @@ -0,0 +1,4 @@ +#[ allow( unused_imports ) ] +use super::*; + +mod basic_test; diff --git a/module/blank/minwebgpu/tests/smoke_test.rs b/module/blank/minwebgpu/tests/smoke_test.rs new file mode 100644 index 0000000000..828e9b016b --- /dev/null +++ b/module/blank/minwebgpu/tests/smoke_test.rs @@ -0,0 +1,14 @@ + + +#[ test ] +fn local_smoke_test() +{ + ::test_tools::smoke_test_for_local_run(); +} + + +#[ test ] +fn published_smoke_test() +{ + ::test_tools::smoke_test_for_published_run(); +} diff --git a/module/blank/minwebgpu/tests/tests.rs b/module/blank/minwebgpu/tests/tests.rs new file mode 100644 index 0000000000..849473f639 --- /dev/null +++ b/module/blank/minwebgpu/tests/tests.rs @@ -0,0 +1,10 @@ + +include!( "../../../../module/step/meta/src/module/terminal.rs" ); + +#[ allow( unused_imports ) ] +use minwebgpu as the_module; +#[ allow( unused_imports ) ] +use test_tools::exposed::*; + +#[ cfg( feature = "enabled" ) ] +mod inc; diff --git a/module/blank/minwgpu/Cargo.toml b/module/blank/minwgpu/Cargo.toml new file mode 100644 index 0000000000..25841190ba --- /dev/null +++ b/module/blank/minwgpu/Cargo.toml @@ -0,0 +1,34 @@ +[package] +name = "minwgpu" +version = "0.1.0" +edition = "2021" +authors = [ + "Kostiantyn Wandalen ", +] +license = "MIT" +readme = "Readme.md" +documentation = "https://docs.rs/minwgpu" +repository = "https://github.com/Wandalen/wTools/tree/master/module/core/minwgpu" +homepage = "https://github.com/Wandalen/wTools/tree/master/module/core/minwgpu" +description = """ +Draw language. +""" +categories = [ "algorithms", "development-tools" ] +keywords = [ "fundamental", "general-purpose" ] + +[lints] +workspace = true + +[package.metadata.docs.rs] +features = [ "full" ] +all-features = false + +[features] +default = [ "enabled" ] +full = [ "enabled" ] +enabled = [] + +[dependencies] + +[dev-dependencies] +test_tools = { workspace = true } diff --git a/module/blank/minwgpu/License b/module/blank/minwgpu/License new file mode 100644 index 0000000000..6d5ef8559f --- /dev/null +++ b/module/blank/minwgpu/License @@ -0,0 +1,22 @@ +Copyright Kostiantyn W and Out of the Box Systems (c) 2013-2024 + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/module/blank/minwgpu/Readme.md b/module/blank/minwgpu/Readme.md new file mode 100644 index 0000000000..1c8ca98d8a --- /dev/null +++ b/module/blank/minwgpu/Readme.md @@ -0,0 +1,33 @@ + + +# Module :: minwgpu +[![experimental](https://raster.shields.io/static/v1?label=stability&message=experimental&color=orange&logoColor=eee)](https://github.com/emersion/stability-badges#experimental) [![rust-status](https://github.com/Wandalen/wTools/actions/workflows/ModuleminwgpuPush.yml/badge.svg)](https://github.com/Wandalen/wTools/actions/workflows/ModuleminwgpuPush.yml) [![docs.rs](https://img.shields.io/docsrs/minwgpu?color=e3e8f0&logo=docs.rs)](https://docs.rs/minwgpu) [![discord](https://img.shields.io/discord/872391416519737405?color=eee&logo=discord&logoColor=eee&label=ask)](https://discord.gg/m3YfbXpUUY) + +Draw language. + + diff --git a/module/blank/minwgpu/src/lib.rs b/module/blank/minwgpu/src/lib.rs new file mode 100644 index 0000000000..8736456366 --- /dev/null +++ b/module/blank/minwgpu/src/lib.rs @@ -0,0 +1,10 @@ + +#![ doc( html_logo_url = "https://raw.githubusercontent.com/Wandalen/wTools/master/asset/img/logo_v3_trans_square.png" ) ] +#![ doc( html_favicon_url = "https://raw.githubusercontent.com/Wandalen/wTools/alpha/asset/img/logo_v3_trans_square_icon_small_v2.ico" ) ] +#![ doc = include_str!( concat!( env!( "CARGO_MANIFEST_DIR" ), "/", "Readme.md" ) ) ] + +/// Function description. +#[ cfg( feature = "enabled" ) ] +pub fn f1() +{ +} diff --git a/module/blank/minwgpu/tests/inc/basic_test.rs b/module/blank/minwgpu/tests/inc/basic_test.rs new file mode 100644 index 0000000000..60c9a81cfb --- /dev/null +++ b/module/blank/minwgpu/tests/inc/basic_test.rs @@ -0,0 +1,7 @@ +#[ allow( unused_imports ) ] +use super::*; + +#[ test ] +fn basic() +{ +} diff --git a/module/blank/minwgpu/tests/inc/mod.rs b/module/blank/minwgpu/tests/inc/mod.rs new file mode 100644 index 0000000000..dde9de6f94 --- /dev/null +++ b/module/blank/minwgpu/tests/inc/mod.rs @@ -0,0 +1,4 @@ +#[ allow( unused_imports ) ] +use super::*; + +mod basic_test; diff --git a/module/blank/minwgpu/tests/smoke_test.rs b/module/blank/minwgpu/tests/smoke_test.rs new file mode 100644 index 0000000000..828e9b016b --- /dev/null +++ b/module/blank/minwgpu/tests/smoke_test.rs @@ -0,0 +1,14 @@ + + +#[ test ] +fn local_smoke_test() +{ + ::test_tools::smoke_test_for_local_run(); +} + + +#[ test ] +fn published_smoke_test() +{ + ::test_tools::smoke_test_for_published_run(); +} diff --git a/module/blank/minwgpu/tests/tests.rs b/module/blank/minwgpu/tests/tests.rs new file mode 100644 index 0000000000..9bcb27960e --- /dev/null +++ b/module/blank/minwgpu/tests/tests.rs @@ -0,0 +1,10 @@ + +include!( "../../../../module/step/meta/src/module/terminal.rs" ); + +#[ allow( unused_imports ) ] +use minwgpu as the_module; +#[ allow( unused_imports ) ] +use test_tools::exposed::*; + +#[ cfg( feature = "enabled" ) ] +mod inc; diff --git a/module/core/meta_tools/src/lib.rs b/module/core/meta_tools/src/lib.rs index cd49c9841e..352f7e0f3b 100644 --- a/module/core/meta_tools/src/lib.rs +++ b/module/core/meta_tools/src/lib.rs @@ -29,12 +29,15 @@ pub mod dependency } +mod private {} + // // qqq : meta interface should be optional dependancy. please fix writing equivalent code manually #[ cfg( feature = "enabled" ) ] mod_interface::mod_interface! { + // #![ debug ] layer meta; diff --git a/module/core/mod_interface/Cargo.toml b/module/core/mod_interface/Cargo.toml index 438141b1e3..4c7f49cca8 100644 --- a/module/core/mod_interface/Cargo.toml +++ b/module/core/mod_interface/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "mod_interface" -version = "0.24.0" +version = "0.25.0" edition = "2021" authors = [ "Kostiantyn Wandalen ", diff --git a/module/core/mod_interface/Readme.md b/module/core/mod_interface/Readme.md index 72573cc881..47115efb68 100644 --- a/module/core/mod_interface/Readme.md +++ b/module/core/mod_interface/Readme.md @@ -5,109 +5,164 @@ [![experimental](https://raster.shields.io/static/v1?label=&message=experimental&color=orange)](https://github.com/emersion/stability-badges#experimental) [![rust-status](https://github.com/Wandalen/wTools/actions/workflows/module_mod_interface_push.yml/badge.svg)](https://github.com/Wandalen/wTools/actions/workflows/module_mod_interface_push.yml) [![docs.rs](https://img.shields.io/docsrs/mod_interface?color=e3e8f0&logo=docs.rs)](https://docs.rs/mod_interface) [![discord](https://img.shields.io/discord/872391416519737405?color=eee&logo=discord&logoColor=eee&label=ask)](https://discord.gg/m3YfbXpUUY) -Protocol of modularity unifying interface of a module and introducing layers. +Protocol of modularity unifying interface. -### Basic use-case +### Problem Solved -Library file with code `inner.rs`: +The `mod_interface` crate provides a structured approach to modularity, addressing two key challenges in software development: -```rust ignore -mod private +1. **Meaningful Namespace Structuring**: The crate enables developers to organize program entities into meaningful namespaces ( read modules ) without additional development overhead. This is achieved through a set of auto-importing rules and a flexible inversion of control mechanism, allowing parent namespaces to delegate control over its items to child namespaces. This approach ensures that each namespace is self-contained and meaningful, promoting better organization and modularity. + +2. **Enhanced Readability and Tooling Independence**: By requiring a `mod private` section that lists all items ( read functions, structures, traits, types ) the `mod_interface` macro encourages developers to create a concise list of items at the beginning or end of a file. This improves readability, encourages refactoring, and reduces cognitive load by providing a clear, high-level grouping of items. Code tooling is not always reliable and can sometimes be counterproductive by automating tasks that should be done manually to achieve more concise code. While code tooling like `rust_analyzer` are useful, this approach minimizes reliance on them, making the program's structure easier to understand and manage. + +While some may argue that inversion of control over namespaces may not always achieve the desired outcome, and code tooling can be sufficient, the `mod_interface` crate offers a cathartic solution for designing complex systems where tooling and triditional structuring often fall short. By promoting a clear and organized structure, it helps developers grasp the semantics of their programs more holistically. + +### Example : Trivial + +This example demonstrates how to use the `mod_interface` crate to organize a Rust program into structured namespaces. The code is divided into a library file (`child.rs`) and a main function. The library file defines a module with private functions and uses the `mod_interface` macro to specify which functions should be exposed in different namespaces. The main function then tests the visibility and accessibility of these functions. + +```rust +use mod_interface::mod_interface; + +// Define a module named `child`. +mod child { - /// Routine of inner module. - pub fn inner_is() -> bool + + // Define a private namespace for all its items. + mod private { - true + /// Only my thing. + pub fn my_thing() -> bool { true } + /// Parent module should also has this thing. + pub fn orphan_thing() -> bool { true } + /// This thing should be exposed. + pub fn exposed_thing() -> bool { true } + /// This thing should be in prelude. + pub fn prelude_thing() -> bool { true } } -} -// + // + + crate::mod_interface! + { + own use my_thing; + orphan use orphan_thing; + exposed use exposed_thing; + prelude use prelude_thing; + } -mod_interface::mod_interface! -{ - prelude use inner_is; } -``` -Main file that generates modules and namespaces `main.rs` : +// Priave namespaces is necessary. +mod private {} -```rust ignore -use mod_interface::mod_interface; +crate::mod_interface! +{ + /// Inner. + use super::child; +} -// fn main() { - assert_eq!( prelude::inner_is(), inner::prelude::inner_is() ); -} -// + assert!( child::prelude_thing(), "prelude thing of child is there" ); + assert!( prelude_thing(), "and here" ); + assert!( own::prelude_thing(), "and here" ); + assert!( orphan::prelude_thing(), "and here" ); + assert!( exposed::prelude_thing(), "and here" ); + assert!( prelude::prelude_thing(), "and here" ); + + assert!( child::exposed_thing(), "exposed thing of child is there" ); + assert!( exposed_thing(), "and here" ); + assert!( own::exposed_thing(), "and here" ); + assert!( orphan::exposed_thing(), "and here" ); + assert!( exposed::exposed_thing(), "and here" ); + // assert!( prelude::exposed_thing(), "but not here" ); + + assert!( child::orphan_thing(), "orphan thing of child is there" ); + assert!( orphan_thing(), "orphan thing of child is here" ); + assert!( own::orphan_thing(), "and here" ); + // assert!( orphan::orphan_thing(), "but not here" ); + // assert!( exposed::orphan_thing(), "and not here" ); + // assert!( prelude::orphan_thing(), "and not here" ); + + assert!( child::my_thing(), "own thing of child is only there" ); + // assert!( my_thing(), "and not here" ); + // assert!( own::my_thing(), "and not here" ); + // assert!( orphan::my_thing(), "and not here" ); + // assert!( exposed::my_thing(), "and not here" ); + // assert!( prelude::my_thing(), "and not here" ); -mod_interface::mod_interface! -{ - /// Inner. - layer inner; } + ``` -It generates code : +
+The code above will be expanded to this ```rust use mod_interface::mod_interface; -// - -fn main() -{ - assert_eq!( prelude::inner_is(), inner::prelude::inner_is() ); -} - -// - -/// Inner. -pub mod inner +// Define a module named `child` +pub mod child { + // Define a private namespace for all its items. mod private { - /// Routine of inner module. - pub fn inner_is() -> bool { true } + /// Only my thing. + pub fn my_thing() -> bool { true } + /// Parent module should also has this thing. + pub fn orphan_thing() -> bool { true } + /// This thing should be exposed. + pub fn exposed_thing() -> bool { true } + /// This thing should be in prelude. + pub fn prelude_thing() -> bool { true } } + pub use own::*; + /// Own namespace of the module. pub mod own { - pub use orphan::*; + pub use super::orphan::*; + pub use super::private::my_thing; } - pub use own::*; /// Orphan namespace of the module. pub mod orphan { - pub use exposed::*; + pub use super::exposed::*; + pub use super::private::orphan_thing; } /// Exposed namespace of the module. pub mod exposed { - pub use prelude::*; + pub use super::prelude::*; + pub use super::private::exposed_thing; } /// Prelude to use essentials: `use my_module::prelude::*`. pub mod prelude { - pub use private::inner_is; + pub use super::private::prelude_thing; } } +// Priave namespaces is necessary. +mod private {} + +pub use own::*; + /// Own namespace of the module. #[ allow( unused_imports ) ] pub mod own { use super::*; pub use orphan::*; - pub use super::inner::orphan::*; + pub use super::child::orphan::*; } -pub use own::*; /// Orphan namespace of the module. #[ allow( unused_imports ) ] @@ -123,7 +178,7 @@ pub mod exposed { use super::*; pub use prelude::*; - pub use super::inner::exposed::*; + pub use super::child::exposed::*; } /// Prelude to use essentials: `use my_module::prelude::*`. @@ -131,10 +186,48 @@ pub mod exposed pub mod prelude { use super::*; - pub use super::inner::prelude::*; + pub use super::child::prelude::*; +} + +// + +fn main() +{ + + assert!( child::prelude_thing(), "prelude thing of child is there" ); + assert!( prelude_thing(), "and here" ); + assert!( own::prelude_thing(), "and here" ); + assert!( orphan::prelude_thing(), "and here" ); + assert!( exposed::prelude_thing(), "and here" ); + assert!( prelude::prelude_thing(), "and here" ); + + assert!( child::exposed_thing(), "exposed thing of child is there" ); + assert!( exposed_thing(), "and here" ); + assert!( own::exposed_thing(), "and here" ); + assert!( orphan::exposed_thing(), "and here" ); + assert!( exposed::exposed_thing(), "and here" ); + // assert!( prelude::exposed_thing(), "but not here" ); + + assert!( child::orphan_thing(), "orphan thing of child is there" ); + assert!( orphan_thing(), "orphan thing of child is here" ); + assert!( own::orphan_thing(), "and here" ); + // assert!( orphan::orphan_thing(), "but not here" ); + // assert!( exposed::orphan_thing(), "and not here" ); + // assert!( prelude::orphan_thing(), "and not here" ); + + assert!( child::my_thing(), "own thing of child is only there" ); + // assert!( my_thing(), "and not here" ); + // assert!( own::my_thing(), "and not here" ); + // assert!( orphan::my_thing(), "and not here" ); + // assert!( exposed::my_thing(), "and not here" ); + // assert!( prelude::my_thing(), "and not here" ); + } + ``` +
+ ### Debugging To debug module interface use directive `#![ debug ]` in macro `mod_interface`. Let's update the main file of the example : @@ -144,7 +237,7 @@ mod_interface::mod_interface! { #![ debug ] /// Inner. - layer inner; + layer child; } ``` diff --git a/module/core/mod_interface/examples/mod_interface_debug/Readme.md b/module/core/mod_interface/examples/mod_interface_debug/Readme.md index 6cc31966fb..d57023c6a5 100644 --- a/module/core/mod_interface/examples/mod_interface_debug/Readme.md +++ b/module/core/mod_interface/examples/mod_interface_debug/Readme.md @@ -6,8 +6,10 @@ A sample demonstrates basic usage of macro `mod_interface`. -In file `inner.rs` demonstrated how to generate module interface from namespace `private` and its public routine. +In file `child.rs` demonstrated how to generate module interface from namespace `private` and its public routine. In file `main.rs` demonstrated how to generate module interface from layer ( file with full module interface ). The directive `#![ debug ]` in declaration of macro `mod_interface` allow to show generated module interface as the standard output in compile time. + + \ No newline at end of file diff --git a/module/core/mod_interface/examples/mod_interface_debug/src/inner.rs b/module/core/mod_interface/examples/mod_interface_debug/src/child.rs similarity index 80% rename from module/core/mod_interface/examples/mod_interface_debug/src/inner.rs rename to module/core/mod_interface/examples/mod_interface_debug/src/child.rs index cc62b2c56b..dd734212d9 100644 --- a/module/core/mod_interface/examples/mod_interface_debug/src/inner.rs +++ b/module/core/mod_interface/examples/mod_interface_debug/src/child.rs @@ -1,6 +1,6 @@ mod private { - /// Routine of inner module. + /// Routine of child module. pub fn inner_is() -> bool { true diff --git a/module/core/mod_interface/examples/mod_interface_debug/src/main.rs b/module/core/mod_interface/examples/mod_interface_debug/src/main.rs index e316b7acd6..985f4f49f7 100644 --- a/module/core/mod_interface/examples/mod_interface_debug/src/main.rs +++ b/module/core/mod_interface/examples/mod_interface_debug/src/main.rs @@ -3,16 +3,18 @@ use mod_interface::mod_interface; // -fn main() +mod private {} +mod_interface! { - assert_eq!( prelude::inner_is(), inner::prelude::inner_is() ); + // Uncomment to see expanded code. + // #![ debug ] + /// Child. + layer child; } // -mod_interface! +fn main() { - #![ debug ] - /// Inner. - layer inner; + assert_eq!( prelude::inner_is(), child::prelude::inner_is() ); } diff --git a/module/core/mod_interface/examples/mod_interface_trivial/src/child.rs b/module/core/mod_interface/examples/mod_interface_trivial/src/child.rs new file mode 100644 index 0000000000..4ea0121559 --- /dev/null +++ b/module/core/mod_interface/examples/mod_interface_trivial/src/child.rs @@ -0,0 +1,23 @@ + +// Define a private namespace for all its items. +mod private +{ + /// Only my thing. + pub fn my_thing() -> bool { true } + /// Parent module should also has this thing. + pub fn orphan_thing() -> bool { true } + /// This thing should be exposed. + pub fn exposed_thing() -> bool { true } + /// This thing should be in prelude. + pub fn prelude_thing() -> bool { true } +} + +// + +crate::mod_interface! +{ + own use my_thing; + orphan use orphan_thing; + exposed use exposed_thing; + prelude use prelude_thing; +} diff --git a/module/core/mod_interface/examples/mod_interface_trivial/src/inner.rs b/module/core/mod_interface/examples/mod_interface_trivial/src/inner.rs deleted file mode 100644 index cc62b2c56b..0000000000 --- a/module/core/mod_interface/examples/mod_interface_trivial/src/inner.rs +++ /dev/null @@ -1,15 +0,0 @@ -mod private -{ - /// Routine of inner module. - pub fn inner_is() -> bool - { - true - } -} - -// - -mod_interface::mod_interface! -{ - prelude use inner_is; -} diff --git a/module/core/mod_interface/examples/mod_interface_trivial/src/main.rs b/module/core/mod_interface/examples/mod_interface_trivial/src/main.rs index 03b8905594..420a6c9fb4 100644 --- a/module/core/mod_interface/examples/mod_interface_trivial/src/main.rs +++ b/module/core/mod_interface/examples/mod_interface_trivial/src/main.rs @@ -1,21 +1,49 @@ -//! qqq : write proper descriptionuse mod_interface::mod_interface; - -// +//! This example demonstrates how to use the `mod_interface` crate to organize a Rust program into structured namespaces. The code is divided into a library file (`child.rs`) and a main function. The library file defines a module with private functions and uses the `mod_interface` macro to specify which functions should be exposed in different namespaces. The main function then tests the visibility and accessibility of these functions. use mod_interface::mod_interface; -fn main() -{ - assert_eq!( prelude::inner_is(), prelude::inner_is() ); -} +/// Children. +mod child; -// +// Priave namespaces is necessary. +mod private {} -mod_interface! +crate::mod_interface! { /// Inner. - layer inner; + use super::child; } -// qqq : rewrite sample -/* aaa : Dmytro : sample with layer */ + +fn main() +{ + + assert!( child::prelude_thing(), "prelude thing of child is there" ); + assert!( prelude_thing(), "and here" ); + assert!( own::prelude_thing(), "and here" ); + assert!( orphan::prelude_thing(), "and here" ); + assert!( exposed::prelude_thing(), "and here" ); + assert!( prelude::prelude_thing(), "and here" ); + + assert!( child::exposed_thing(), "exposed thing of child is there" ); + assert!( exposed_thing(), "and here" ); + assert!( own::exposed_thing(), "and here" ); + assert!( orphan::exposed_thing(), "and here" ); + assert!( exposed::exposed_thing(), "and here" ); + // assert!( prelude::exposed_thing(), "but not here" ); + + assert!( child::orphan_thing(), "orphan thing of child is there" ); + assert!( orphan_thing(), "orphan thing of child is here" ); + assert!( own::orphan_thing(), "and here" ); + // assert!( orphan::orphan_thing(), "but not here" ); + // assert!( exposed::orphan_thing(), "and not here" ); + // assert!( prelude::orphan_thing(), "and not here" ); + + assert!( child::my_thing(), "own thing of child is only there" ); + // assert!( my_thing(), "and not here" ); + // assert!( own::my_thing(), "and not here" ); + // assert!( orphan::my_thing(), "and not here" ); + // assert!( exposed::my_thing(), "and not here" ); + // assert!( prelude::my_thing(), "and not here" ); + +} diff --git a/module/core/mod_interface/tests/inc/derive/attr_debug/mod.rs b/module/core/mod_interface/tests/inc/derive/attr_debug/mod.rs index 939ebcdfb3..57b54aff39 100644 --- a/module/core/mod_interface/tests/inc/derive/attr_debug/mod.rs +++ b/module/core/mod_interface/tests/inc/derive/attr_debug/mod.rs @@ -1,9 +1,11 @@ use super::*; +mod private {} + mod_interface! { - #![ debug ] + // #![ debug ] /// layer_a layer layer_a; diff --git a/module/core/mod_interface/tests/inc/derive/micro_modules/mod.rs b/module/core/mod_interface/tests/inc/derive/micro_modules/mod.rs index 09c94a139e..80d4c7218a 100644 --- a/module/core/mod_interface/tests/inc/derive/micro_modules/mod.rs +++ b/module/core/mod_interface/tests/inc/derive/micro_modules/mod.rs @@ -8,6 +8,7 @@ mod private mod_interface! { + // #![ debug ] /// mod_own own mod mod_own; diff --git a/module/core/mod_interface/tests/inc/derive/micro_modules/mod_protected.rs b/module/core/mod_interface/tests/inc/derive/micro_modules/mod_own.rs similarity index 100% rename from module/core/mod_interface/tests/inc/derive/micro_modules/mod_protected.rs rename to module/core/mod_interface/tests/inc/derive/micro_modules/mod_own.rs diff --git a/module/core/mod_interface/tests/inc/manual/micro_modules/mod_protected.rs b/module/core/mod_interface/tests/inc/derive/micro_modules_glob/child.rs similarity index 100% rename from module/core/mod_interface/tests/inc/manual/micro_modules/mod_protected.rs rename to module/core/mod_interface/tests/inc/derive/micro_modules_glob/child.rs diff --git a/module/core/mod_interface/tests/inc/derive/micro_modules_glob/mod.rs b/module/core/mod_interface/tests/inc/derive/micro_modules_glob/mod.rs new file mode 100644 index 0000000000..40ccb61f64 --- /dev/null +++ b/module/core/mod_interface/tests/inc/derive/micro_modules_glob/mod.rs @@ -0,0 +1,28 @@ + +// use super::*; + +/// Internal namespace. +mod private +{ + pub struct Struct1; + pub struct Struct2; +} + +// + +crate::mod_interface! +{ + own use + { + * + }; +} + +// + +#[ test ] +fn basic() +{ + let _s1 = Struct1; + let _s2 = Struct2; +} diff --git a/module/core/mod_interface/tests/inc/derive/micro_modules_two/mod_protected1.rs b/module/core/mod_interface/tests/inc/derive/micro_modules_two/mod_own1.rs similarity index 100% rename from module/core/mod_interface/tests/inc/derive/micro_modules_two/mod_protected1.rs rename to module/core/mod_interface/tests/inc/derive/micro_modules_two/mod_own1.rs diff --git a/module/core/mod_interface/tests/inc/derive/micro_modules_two/mod_protected2.rs b/module/core/mod_interface/tests/inc/derive/micro_modules_two/mod_own2.rs similarity index 100% rename from module/core/mod_interface/tests/inc/derive/micro_modules_two/mod_protected2.rs rename to module/core/mod_interface/tests/inc/derive/micro_modules_two/mod_own2.rs diff --git a/module/core/mod_interface/tests/inc/derive/micro_modules_two_joined/mod_protected1.rs b/module/core/mod_interface/tests/inc/derive/micro_modules_two_joined/mod_own1.rs similarity index 100% rename from module/core/mod_interface/tests/inc/derive/micro_modules_two_joined/mod_protected1.rs rename to module/core/mod_interface/tests/inc/derive/micro_modules_two_joined/mod_own1.rs diff --git a/module/core/mod_interface/tests/inc/derive/micro_modules_two_joined/mod_protected2.rs b/module/core/mod_interface/tests/inc/derive/micro_modules_two_joined/mod_own2.rs similarity index 100% rename from module/core/mod_interface/tests/inc/derive/micro_modules_two_joined/mod_protected2.rs rename to module/core/mod_interface/tests/inc/derive/micro_modules_two_joined/mod_own2.rs diff --git a/module/core/mod_interface/tests/inc/derive/reuse_basic/child.rs b/module/core/mod_interface/tests/inc/derive/reuse_basic/child.rs new file mode 100644 index 0000000000..d94a40b5bd --- /dev/null +++ b/module/core/mod_interface/tests/inc/derive/reuse_basic/child.rs @@ -0,0 +1,15 @@ +mod private +{ + pub struct Own; + pub struct Orphan; + pub struct Exposed; + pub struct Prelude; +} + +crate::mod_interface! +{ + own use Own; + orphan use Orphan; + exposed use Exposed; + prelude use Prelude; +} diff --git a/module/core/mod_interface/tests/inc/derive/reuse_basic/mod.rs b/module/core/mod_interface/tests/inc/derive/reuse_basic/mod.rs new file mode 100644 index 0000000000..55daeb2a1c --- /dev/null +++ b/module/core/mod_interface/tests/inc/derive/reuse_basic/mod.rs @@ -0,0 +1,34 @@ + +// use super::*; + +/// Internal namespace. +mod private +{ +} + +mod child; + +// + +crate::mod_interface! +{ + reuse child; +} + +// + +#[ test ] +fn basic() +{ + + let _ = child::Own; + let _ = child::Orphan; + let _ = child::Exposed; + let _ = child::Prelude; + + let _ = Own; + let _ = Orphan; + let _ = Exposed; + let _ = Prelude; + +} diff --git a/module/core/mod_interface/tests/inc/derive/use_as/derive.rs b/module/core/mod_interface/tests/inc/derive/use_as/derive.rs index 4c452702b0..a70260fc3c 100644 --- a/module/core/mod_interface/tests/inc/derive/use_as/derive.rs +++ b/module/core/mod_interface/tests/inc/derive/use_as/derive.rs @@ -4,6 +4,8 @@ use super::*; /// Layer X pub mod layer_x; +mod private {} + mod_interface! { // #![ debug ] @@ -13,7 +15,7 @@ mod_interface! // /// layer_a // pub use super::layer_x as layer_a; - // xxx : make that working + // zzz : make that working } diff --git a/module/core/mod_interface/tests/inc/derive/use_as/manual_only.rs b/module/core/mod_interface/tests/inc/derive/use_as/manual_only.rs index f6fcb2f162..9ce347e8fb 100644 --- a/module/core/mod_interface/tests/inc/derive/use_as/manual_only.rs +++ b/module/core/mod_interface/tests/inc/derive/use_as/manual_only.rs @@ -3,7 +3,7 @@ use layer_x as layer_a; #[doc(inline)] #[allow(unused_imports)] -pub use protected :: * ; +pub use own :: * ; #[doc = r" Own namespace of the module."] #[ allow( unused_imports ) ] diff --git a/module/core/mod_interface/tests/inc/derive/use_basic/mod.rs b/module/core/mod_interface/tests/inc/derive/use_basic/mod.rs index 3cfbb3ad53..fe3862d5b3 100644 --- a/module/core/mod_interface/tests/inc/derive/use_basic/mod.rs +++ b/module/core/mod_interface/tests/inc/derive/use_basic/mod.rs @@ -4,6 +4,8 @@ use super::*; mod layer_a; mod layer_b; +mod private {} + mod_interface! { diff --git a/module/core/mod_interface/tests/inc/derive/use_layer/mod.rs b/module/core/mod_interface/tests/inc/derive/use_layer/mod.rs index 17247d2d07..a7f1790c60 100644 --- a/module/core/mod_interface/tests/inc/derive/use_layer/mod.rs +++ b/module/core/mod_interface/tests/inc/derive/use_layer/mod.rs @@ -6,11 +6,6 @@ mod tools pub use super::super::*; } -// /// Private namespace of the module. -// mod private -// { -// } - mod layer_a; /// SuperStruct1. @@ -19,6 +14,8 @@ pub struct SuperStruct1 { } +mod private {} + mod_interface! { diff --git a/module/core/mod_interface/tests/inc/manual/micro_modules/mod_own.rs b/module/core/mod_interface/tests/inc/manual/micro_modules/mod_own.rs new file mode 100644 index 0000000000..a6619cc0c4 --- /dev/null +++ b/module/core/mod_interface/tests/inc/manual/micro_modules/mod_own.rs @@ -0,0 +1,5 @@ +/// has_own +pub fn has_own() -> bool +{ + true +} \ No newline at end of file diff --git a/module/core/mod_interface/tests/inc/manual/micro_modules_two/mod_protected1.rs b/module/core/mod_interface/tests/inc/manual/micro_modules_two/mod_own1.rs similarity index 100% rename from module/core/mod_interface/tests/inc/manual/micro_modules_two/mod_protected1.rs rename to module/core/mod_interface/tests/inc/manual/micro_modules_two/mod_own1.rs diff --git a/module/core/mod_interface/tests/inc/manual/micro_modules_two/mod_protected2.rs b/module/core/mod_interface/tests/inc/manual/micro_modules_two/mod_own2.rs similarity index 100% rename from module/core/mod_interface/tests/inc/manual/micro_modules_two/mod_protected2.rs rename to module/core/mod_interface/tests/inc/manual/micro_modules_two/mod_own2.rs diff --git a/module/core/mod_interface/tests/inc/mod.rs b/module/core/mod_interface/tests/inc/mod.rs index 5d8aaa7045..f838c57b50 100644 --- a/module/core/mod_interface/tests/inc/mod.rs +++ b/module/core/mod_interface/tests/inc/mod.rs @@ -22,6 +22,7 @@ mod derive mod micro_modules; mod micro_modules_two; mod micro_modules_two_joined; + mod micro_modules_glob; // layer mod layer; @@ -33,6 +34,7 @@ mod derive mod layer_use_cfg; mod layer_use_macro; + // use mod use_layer; mod use_basic; #[ path = "./use_as/derive.rs" ] @@ -40,9 +42,14 @@ mod derive #[ path = "./use_as/manual.rs" ] mod use_as_manual; + // reuse + mod reuse_basic; + // attr mod attr_debug; } -mod trybuild_test; +// mod trybuild_test; + +// xxx : enable \ No newline at end of file diff --git a/module/core/mod_interface_meta/Cargo.toml b/module/core/mod_interface_meta/Cargo.toml index b3de1c7f95..687f54ddbe 100644 --- a/module/core/mod_interface_meta/Cargo.toml +++ b/module/core/mod_interface_meta/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "mod_interface_meta" -version = "0.24.0" +version = "0.25.0" edition = "2021" authors = [ "Kostiantyn Wandalen ", diff --git a/module/core/mod_interface_meta/src/impls.rs b/module/core/mod_interface_meta/src/impls.rs index 737dab4d78..58fec18e93 100644 --- a/module/core/mod_interface_meta/src/impls.rs +++ b/module/core/mod_interface_meta/src/impls.rs @@ -16,7 +16,7 @@ mod private // = ? // x - // protected protected1; + // own own1; // orphan orphan1; // exposed exposed1; // prelude prelude1; @@ -33,7 +33,7 @@ mod private // x // orphan macromod mod_orphan1; - // : protected -> protected + // : own -> own // : orphan -> orphan // : exposed -> orphan // : prelude -> orphan @@ -42,14 +42,14 @@ mod private // x // prelude exposed macromod mod_own1; - // : protected -> exposed + // : own -> exposed // : orphan -> exposed // : exposed -> exposed // : prelude -> prelude // x - // prelude protected macromod mod_exposed1; - // : protected -> protected + // prelude own macromod mod_exposed1; + // : own -> own // : orphan -> orphan // : exposed -> exposed // : prelude -> prelude @@ -58,14 +58,14 @@ mod private // x // exposed exposed macromod mod_exposed1; - // : protected -> exposed + // : own -> exposed // : orphan -> exposed // : exposed -> exposed // : prelude -> exposed // x // exposed orphan macromod mod_exposed1; - // : protected -> orphan + // : own -> orphan // : orphan -> orphan // : exposed -> exposed // : prelude -> exposed @@ -102,12 +102,10 @@ mod private /// /// Handle record "use" with implicit visibility. /// - #[ allow ( dead_code ) ] - fn record_use_implicit + fn record_reuse_implicit ( record : &Record, c : &'_ mut RecordContext< '_ >, - // clauses_map : &mut HashMap< u32, Vec< proc_macro2::TokenStream > >, ) -> syn::Result< () > @@ -115,35 +113,88 @@ mod private let attrs1 = &record.attrs; let path = record.use_elements.as_ref().unwrap(); - // let vis = record.vis.clone(); - // if vis == Visibility::Inherited + let path = if let Some( rename ) = &path.rename + { + let pure_path = path.pure_without_super_path()?; + c.clauses_map.get_mut( &ClauseImmediates::Kind() ).unwrap().push( qt! + { + pub use #pure_path as #rename; + }); + parse_qt!{ #rename } + } + else + { + path.clone() + }; - // xxx + let adjsuted_path = path.prefixed_with_all(); - // let _path; - // let path2 = if path.prefix_is_needed() - // { - // _path = parse_qt!{ super::private::#path }; - // &_path - // } - // else - // { - // path - // }; + c.clauses_map.get_mut( &VisOwn::Kind() ).unwrap().push( qt! + { + #[ doc( inline ) ] + #[ allow( unused_imports ) ] + #attrs1 + pub use #adjsuted_path::own::*; + }); - let adjsuted_path = path.adjsuted_implicit_path()?; + c.clauses_map.get_mut( &VisOrphan::Kind() ).unwrap().push( qt! + { + #[ doc( inline ) ] + #[ allow( unused_imports ) ] + #attrs1 + pub use #adjsuted_path::orphan::*; + }); - // println!( "adjsuted_path : {}", qt!{ #adjsuted_path } ); + c.clauses_map.get_mut( &VisExposed::Kind() ).unwrap().push( qt! + { + #[ doc( inline ) ] + #[ allow( unused_imports ) ] + #attrs1 + pub use #adjsuted_path::exposed::*; + }); - if let Some( rename ) = &path.rename + c.clauses_map.get_mut( &VisPrelude::Kind() ).unwrap().push( qt! + { + #[ doc( inline ) ] + #[ allow( unused_imports ) ] + #attrs1 + pub use #adjsuted_path::prelude::*; + }); + + Ok( () ) + } + + /// + /// Handle record "use" with implicit visibility. + /// + fn record_use_implicit + ( + record : &Record, + c : &'_ mut RecordContext< '_ >, + ) + -> + syn::Result< () > + { + + let attrs1 = &record.attrs; + let path = record.use_elements.as_ref().unwrap(); + + let path = if let Some( rename ) = &path.rename { let pure_path = path.pure_without_super_path()?; c.clauses_map.get_mut( &ClauseImmediates::Kind() ).unwrap().push( qt! { pub use #pure_path as #rename; }); + parse_qt!{ #rename } } + else + { + path.clone() + }; + + let adjsuted_path = path.prefixed_with_all(); c.clauses_map.get_mut( &VisOwn::Kind() ).unwrap().push( qt! { @@ -175,12 +226,10 @@ mod private /// /// Handle record "use" with explicit visibility. /// - #[ allow ( dead_code ) ] fn record_use_explicit ( record : &Record, c : &'_ mut RecordContext< '_ >, - // clauses_map : &mut HashMap< u32, Vec< proc_macro2::TokenStream > >, ) -> syn::Result< () > @@ -200,8 +249,7 @@ mod private )); } - let adjsuted_path = path.adjsuted_explicit_path(); - + let adjsuted_path = path.prefixed_with_all(); let vis2 = if vis.restriction().is_some() { qt!{ pub( crate ) } @@ -248,13 +296,16 @@ mod private if !record.vis.valid_sub_namespace() { - return Err( syn_err! + return Err ( - record, - "To include a non-standard module use either {} visibility:\n {}", - VALID_VISIBILITY_LIST_STR, - qt!{ #record }, - )); + syn_err! + ( + record, + "To include a non-standard module use either {} visibility:\n {}", + VALID_VISIBILITY_LIST_STR, + qt!{ #record }, + ) + ); } c.clauses_map.get_mut( &record.vis.kind() ).unwrap().push( qt! @@ -263,7 +314,8 @@ mod private #[ allow( unused_imports ) ] #attrs1 #attrs2 - pub use #path; + pub use __all__::#path; + // pub use super::#path; // xxx : remove super? }); @@ -310,7 +362,7 @@ mod private #[ allow( unused_imports ) ] #attrs1 #attrs2 - pub use #path::orphan::*; + pub use __all__::#path::orphan::*; }); c.clauses_map.get_mut( &VisExposed::Kind() ).unwrap().push( qt! @@ -319,7 +371,7 @@ mod private #[ allow( unused_imports ) ] #attrs1 #attrs2 - pub use #path::exposed::*; + pub use __all__::#path::exposed::*; }); c.clauses_map.get_mut( &VisPrelude::Kind() ).unwrap().push( qt! @@ -328,7 +380,7 @@ mod private #[ allow( unused_imports ) ] #attrs1 #attrs2 - pub use #path::prelude::*; + pub use __all__::#path::prelude::*; }); Ok( () ) @@ -383,6 +435,23 @@ mod private record_use_explicit( record, &mut record_context )?; } }, + Reuse( _ ) => + { + let vis = &record.vis; + if vis == &Visibility::Inherited + { + record_reuse_implicit( record, &mut record_context )?; + } + else + { + return Err( syn_err! + ( + record, + "Using visibility usesd before `reuse` is illegal\n{}", + qt!{ #record }, + )); + } + }, _ => { record.elements.iter().try_for_each( | element | -> syn::Result::< () > @@ -397,8 +466,9 @@ mod private { record_layer( record, element, &mut record_context )?; }, - Use( _ ) => + _ => { + panic!( "Unexpected" ) }, } syn::Result::Ok( () ) @@ -410,7 +480,7 @@ mod private })?; let immediates_clause = clauses_map.get( &ClauseImmediates::Kind() ).unwrap(); - let protected_clause = clauses_map.get( &VisOwn::Kind() ).unwrap(); + let own_clause = clauses_map.get( &VisOwn::Kind() ).unwrap(); let orphan_clause = clauses_map.get( &VisOrphan::Kind() ).unwrap(); let exposed_clause = clauses_map.get( &VisExposed::Kind() ).unwrap(); let prelude_clause = clauses_map.get( &VisPrelude::Kind() ).unwrap(); @@ -420,6 +490,8 @@ mod private #( #immediates_clause )* + // use private as __private__; // this line is necessary for readable error in case private namespace is not present + #[ doc( inline ) ] #[ allow( unused_imports ) ] pub use own::*; @@ -428,19 +500,34 @@ mod private #[ allow( unused_imports ) ] pub mod own { - use super::*; + // There must be internal private namespace + // Because it's not possible to direcly make `use super::*;` + // Because then items from super can't be exposed publicly complaining: + // `error[E0428]: the name `mod1` is defined multiple times` + // use super::*; + use super::private; // this line is necessary for readable error in case private namespace is not present + mod __all__ + { + pub use super::super::*; + pub use super::super::private::*; + } #[ doc( inline ) ] - pub use orphan::*; - #( #protected_clause )* + pub use super::orphan::*; + #( #own_clause )* } /// Orphan namespace of the module. #[ allow( unused_imports ) ] pub mod orphan { - use super::*; + // use super::*; + mod __all__ + { + pub use super::super::*; + pub use super::super::private::*; + } #[ doc( inline ) ] - pub use exposed::*; + pub use super::exposed::*; #( #orphan_clause )* } @@ -448,9 +535,14 @@ mod private #[ allow( unused_imports ) ] pub mod exposed { - use super::*; + // use super::*; + mod __all__ + { + pub use super::super::*; + pub use super::super::private::*; + } #[ doc( inline ) ] - pub use prelude::*; + pub use super::prelude::*; #( #exposed_clause )* } @@ -458,7 +550,12 @@ mod private #[ allow( unused_imports ) ] pub mod prelude { - use super::*; + // use super::*; + mod __all__ + { + pub use super::super::*; + pub use super::super::private::*; + } #( #prelude_clause )* } diff --git a/module/core/mod_interface_meta/src/lib.rs b/module/core/mod_interface_meta/src/lib.rs index bb595ba9a2..0505641d53 100644 --- a/module/core/mod_interface_meta/src/lib.rs +++ b/module/core/mod_interface_meta/src/lib.rs @@ -1,9 +1,10 @@ #![ doc( html_logo_url = "https://raw.githubusercontent.com/Wandalen/wTools/master/asset/img/logo_v3_trans_square.png" ) ] #![ doc( html_favicon_url = "https://raw.githubusercontent.com/Wandalen/wTools/alpha/asset/img/logo_v3_trans_square_icon_small_v2.ico" ) ] #![ doc( html_root_url = "https://docs.rs/mod_interface_meta/latest/mod_interface_meta/" ) ] -#![ deny( dead_code ) ] #![ doc = include_str!( concat!( env!( "CARGO_MANIFEST_DIR" ), "/", "Readme.md" ) ) ] +#![ warn( dead_code ) ] + // xxx : clean up, ad solve problems // - example based on simpified version of test::layer_have_layer with single sublayer // - example with attribute `#![ debug ]` diff --git a/module/core/mod_interface_meta/src/record.rs b/module/core/mod_interface_meta/src/record.rs index c60b0bb55c..70e8f289ec 100644 --- a/module/core/mod_interface_meta/src/record.rs +++ b/module/core/mod_interface_meta/src/record.rs @@ -11,6 +11,7 @@ mod private pub mod kw { super::syn::custom_keyword!( layer ); + super::syn::custom_keyword!( reuse ); } /// @@ -23,6 +24,7 @@ mod private MicroModule( syn::token::Mod ), Layer( kw::layer ), Use( syn::token::Use ), + Reuse( kw::reuse ), } // @@ -47,6 +49,10 @@ mod private { ElementType::Layer( input.parse()? ) }, + _case if lookahead.peek( kw::reuse ) => + { + ElementType::Reuse( input.parse()? ) + }, _default => { return Err( lookahead.error() ) @@ -69,6 +75,7 @@ mod private MicroModule( e ) => e.to_tokens( tokens ), Use( e ) => e.to_tokens( tokens ), Layer( e ) => e.to_tokens( tokens ), + Reuse( e ) => e.to_tokens( tokens ), } } } @@ -104,7 +111,7 @@ mod private match element_type { - ElementType::Use( _ ) => + ElementType::Use( _ ) | ElementType::Reuse( _ ) => { use_elements = Some( input.parse()? ); elements = syn::punctuated::Punctuated::new(); diff --git a/module/core/mod_interface_meta/src/use_tree.rs b/module/core/mod_interface_meta/src/use_tree.rs index f87ee133ad..de6805dd90 100644 --- a/module/core/mod_interface_meta/src/use_tree.rs +++ b/module/core/mod_interface_meta/src/use_tree.rs @@ -105,32 +105,50 @@ mod private Ok( path ) } - /// Adjusted path. - /// Add `super::private::` to path unless it starts from `::` or `super` or `crate`. - pub fn adjsuted_implicit_path( &self ) -> syn::Result< syn::punctuated::Punctuated< syn::Ident, Token![::] > > - { - // use syn::UseTree::*; - let pure_path = self.pure_path()?; - if self.prefix_is_needed() - { - Ok( parse_qt!{ super::private::#pure_path } ) - } - else - { - Ok( pure_path ) - } - } +// /// Adjusted path. +// /// Add `super::private::` to path unless it starts from `::` or `super` or `crate`. +// pub fn adjsuted_implicit_path( &self ) -> syn::Result< syn::punctuated::Punctuated< syn::Ident, Token![::] > > +// { +// // use syn::UseTree::*; +// let pure_path = self.pure_path()?; +// if self.prefix_is_needed() +// { +// Ok( parse_qt!{ super::private::#pure_path } ) +// } +// else +// { +// Ok( pure_path ) +// } +// } +// +// /// Adjusted path. +// /// Add `super::private::` to path unless it starts from `::` or `super` or `crate`. +// // pub fn adjsuted_explicit_path( &self ) -> syn::UseTree +// pub fn adjsuted_explicit_path( &self ) -> Self +// { +// // use syn::UseTree::*; +// if self.prefix_is_needed() +// { +// let mut clone = self.clone(); +// let tree = parse_qt!{ super::private::#self }; +// clone.tree = tree; +// clone +// } +// else +// { +// self.clone() +// } +// } - /// Adjusted path. - /// Add `super::private::` to path unless it starts from `::` or `super` or `crate`. - // pub fn adjsuted_explicit_path( &self ) -> syn::UseTree - pub fn adjsuted_explicit_path( &self ) -> Self + /// Prefix path with __all__ if it's appropriate. + pub fn prefixed_with_all( &self ) -> Self { + // use syn::UseTree::*; if self.prefix_is_needed() { let mut clone = self.clone(); - let tree = parse_qt!{ super::private::#self }; + let tree = parse_qt!{ __all__::#self }; clone.tree = tree; clone } @@ -138,6 +156,7 @@ mod private { self.clone() } + } } diff --git a/module/core/process_tools/src/lib.rs b/module/core/process_tools/src/lib.rs index ceb35389ea..2f91e2f714 100644 --- a/module/core/process_tools/src/lib.rs +++ b/module/core/process_tools/src/lib.rs @@ -7,6 +7,8 @@ #[ cfg( feature = "enabled" ) ] use mod_interface::mod_interface; +mod private {} + #[ cfg( feature = "enabled" ) ] mod_interface! { diff --git a/module/core/proper_path_tools/src/lib.rs b/module/core/proper_path_tools/src/lib.rs index fe0f646c03..297c2aeff8 100644 --- a/module/core/proper_path_tools/src/lib.rs +++ b/module/core/proper_path_tools/src/lib.rs @@ -11,6 +11,8 @@ use mod_interface::mod_interface; #[ macro_use ] extern crate alloc; +mod private {} + #[ cfg( feature = "enabled" ) ] mod_interface! { diff --git a/module/core/test_tools/src/lib.rs b/module/core/test_tools/src/lib.rs index 8baa4d9530..efe6e6d7f0 100644 --- a/module/core/test_tools/src/lib.rs +++ b/module/core/test_tools/src/lib.rs @@ -49,6 +49,10 @@ pub mod dependency } +mod private {} + +// + #[ cfg( feature = "enabled" ) ] // #[ cfg( not( feature = "no_std" ) ) ] ::meta_tools::mod_interface! diff --git a/module/core/test_tools/src/test/compiletime.rs b/module/core/test_tools/src/test/compiletime.rs index 77f9d362ac..4f29ec998e 100644 --- a/module/core/test_tools/src/test/compiletime.rs +++ b/module/core/test_tools/src/test/compiletime.rs @@ -10,10 +10,72 @@ mod private pub use ::trybuild::*; } +// // // +// #[ doc( inline ) ] +// #[ allow( unused_imports ) ] +// pub use own::*; +// +// #[ doc = r" Own namespace of the module." ] +// #[ allow( unused_imports ) ] +// pub mod own +// { +// use super::private; +// mod __all__ +// { +// pub use super::super::*; +// pub use super::super::private::*; +// } +// #[ doc( inline ) ] +// pub use super::orphan::*; +// #[ doc( inline ) ] +// #[ allow( unused_imports ) ] +// pub use private::{*}; +// } +// +// #[ doc = r" Orphan namespace of the module." ] +// #[ allow( unused_imports ) ] +// pub mod orphan +// { +// mod __all__ +// { +// pub use super::super::*; +// pub use super::super::private::*; +// } +// #[ doc( inline ) ] +// pub use super::exposed::*; +// } +// +// #[ doc = r" Exposed namespace of the module." ] +// #[ allow( unused_imports ) ] +// pub mod exposed +// { +// mod __all__ +// { +// pub use super::super::*; +// pub use super::super::private::*; +// } +// #[ doc( inline ) ] +// pub use super::prelude::*; +// #[ doc( inline ) ] +// #[ allow( unused_imports ) ] +// pub use super::super::compiletime; +// } +// +// #[ doc = r" Prelude to use essentials: `use my_module::prelude::*`." ] +// #[ allow( unused_imports ) ] +// pub mod prelude +// { +// mod __all__ +// { +// pub use super::super::*; +// pub use super::super::private::*; +// } +// } crate::mod_interface! { + // #![ debug ] // xxx : make it working // exposed use super; exposed use super::super::compiletime; diff --git a/module/core/test_tools/src/test/helper.rs b/module/core/test_tools/src/test/helper.rs index fe79e69784..49675e2ada 100644 --- a/module/core/test_tools/src/test/helper.rs +++ b/module/core/test_tools/src/test/helper.rs @@ -75,10 +75,10 @@ mod private pub use doc_file_test; } -// - crate::mod_interface! { + // xxx + // #![ debug ] // exposed use super; exposed use super::super::helper; diff --git a/module/core/test_tools/src/test/mod.rs b/module/core/test_tools/src/test/mod.rs index 60ec182ac4..158406fbd1 100644 --- a/module/core/test_tools/src/test/mod.rs +++ b/module/core/test_tools/src/test/mod.rs @@ -3,6 +3,8 @@ //! Tools for testing. //! +mod private {} + // #[ cfg( not( feature = "no_std" ) ) ] crate::mod_interface! { diff --git a/module/move/wca/src/ca/executor/mod.rs b/module/move/wca/src/ca/executor/mod.rs index 77789544d0..1793a9d23f 100644 --- a/module/move/wca/src/ca/executor/mod.rs +++ b/module/move/wca/src/ca/executor/mod.rs @@ -1,3 +1,5 @@ +mod private {} + crate::mod_interface! { diff --git a/module/move/wca/src/ca/grammar/mod.rs b/module/move/wca/src/ca/grammar/mod.rs index f31e992b38..28a87f9e2b 100644 --- a/module/move/wca/src/ca/grammar/mod.rs +++ b/module/move/wca/src/ca/grammar/mod.rs @@ -1,3 +1,5 @@ +mod private {} + crate::mod_interface! { /// User grammar settings. diff --git a/module/move/wca/src/ca/mod.rs b/module/move/wca/src/ca/mod.rs index 3526d2c8fa..66c6832f28 100644 --- a/module/move/wca/src/ca/mod.rs +++ b/module/move/wca/src/ca/mod.rs @@ -2,6 +2,8 @@ //! Commands aggregator library. //! +mod private {} + crate::mod_interface! { diff --git a/module/move/wca/src/ca/parser/mod.rs b/module/move/wca/src/ca/parser/mod.rs index 6d21385d36..50322eee12 100644 --- a/module/move/wca/src/ca/parser/mod.rs +++ b/module/move/wca/src/ca/parser/mod.rs @@ -1,3 +1,5 @@ +mod private {} + crate::mod_interface! { /// This module defines a raw representation of parsed commands, providing a foundation for further processing and @@ -5,7 +7,7 @@ crate::mod_interface! /// a straightforward and easy-to-work-with format, allowing for efficient manipulation and subsequent conversion to /// other representations. layer command; - + /// This module is responsible for processing command-line arguments and parsing them into a raw representation of a /// program containing multiple parsed commands. The input list of arguments is transformed into a structured format, /// allowing the program to efficiently handle and manipulate the parsed commands. diff --git a/module/move/wca/src/ca/tool/mod.rs b/module/move/wca/src/ca/tool/mod.rs index 116804b97d..91290592a7 100644 --- a/module/move/wca/src/ca/tool/mod.rs +++ b/module/move/wca/src/ca/tool/mod.rs @@ -1,3 +1,5 @@ +mod private {} + crate::mod_interface! { diff --git a/module/move/wca/src/ca/verifier/mod.rs b/module/move/wca/src/ca/verifier/mod.rs index 7ed35ae7b9..4723d0bdcc 100644 --- a/module/move/wca/src/ca/verifier/mod.rs +++ b/module/move/wca/src/ca/verifier/mod.rs @@ -1,3 +1,5 @@ +mod private {} + crate::mod_interface! { /// Represents a grammatically correct command with a phrase descriptor, a list of command subjects, and a set of command options.. diff --git a/module/move/wca/src/lib.rs b/module/move/wca/src/lib.rs index c318aa58fd..7f42a20e14 100644 --- a/module/move/wca/src/lib.rs +++ b/module/move/wca/src/lib.rs @@ -11,6 +11,8 @@ use mod_interface::mod_interface; pub mod ca; +mod private {} + crate::mod_interface! { use super::ca; diff --git a/module/move/willbe/src/action/mod.rs b/module/move/willbe/src/action/mod.rs index 728271c2a5..c824bfd6f7 100644 --- a/module/move/willbe/src/action/mod.rs +++ b/module/move/willbe/src/action/mod.rs @@ -1,3 +1,5 @@ +mod private {} + crate::mod_interface! { /// Deploy new. diff --git a/module/move/willbe/src/entity/mod.rs b/module/move/willbe/src/entity/mod.rs index 6f26700128..100b331e89 100644 --- a/module/move/willbe/src/entity/mod.rs +++ b/module/move/willbe/src/entity/mod.rs @@ -1,3 +1,5 @@ +mod private {} + crate::mod_interface! { /// Rust toolchain channel: stable/nightly. diff --git a/module/move/willbe/src/tool/mod.rs b/module/move/willbe/src/tool/mod.rs index 060a323c2f..719b616b4b 100644 --- a/module/move/willbe/src/tool/mod.rs +++ b/module/move/willbe/src/tool/mod.rs @@ -1,3 +1,5 @@ +mod private {} + crate::mod_interface! {