Skip to content

Commit

Permalink
Merge pull request Wandalen#1328 from Barsik-sus/wca-documentation
Browse files Browse the repository at this point in the history
READY: (wca): Improved documentation for modules: clarified descriptions and attributes
  • Loading branch information
Wandalen authored May 13, 2024
2 parents 317316a + 7cb25cd commit aa59cd7
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 54 deletions.
3 changes: 2 additions & 1 deletion module/move/wca/src/ca/grammar/mod.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
crate::mod_interface!
{
/// User grammar settings.
/// By using this module, you can define a new commands and provide a detailed descriptions of them.
layer command;
/// -
/// A dictionary is a collection of commands that can be easily looked up and used.
layer dictionary;
/// Available types for arguments.
layer types;
Expand Down
11 changes: 5 additions & 6 deletions module/move/wca/src/ca/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,21 @@ crate::mod_interface!
/// This component is responsible for performing
layer executor;

// /// This component is responsible for aggregating all commands
// layer commands_aggregator;

/// User input
/// Provides functionality for working with input data, including asking user questions and converting various string representations into a uniform `Input` struct.
layer input;

// /// The missing batteries of WCA.
// layer facade;
/// Genera-purpose tools which might be moved out one day.
layer tool;

/// Responsible for aggregating all commands that the user defines, and for parsing and executing them
layer aggregator;
/// Helper commands
/// This module provides functionality for generating help content for commands.
layer help;
/// Responsible for generating Markdown formatted documentation for commands
layer formatter;
// qqq : for Bohdan : write concise documentations
// aaa : for Bohdan : write concise documentations
// aaa : Is this enough or is more needed?

}
9 changes: 7 additions & 2 deletions module/move/wca/src/ca/parser/mod.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
crate::mod_interface!
{
/// Parsed command
/// This module defines a raw representation of parsed commands, providing a foundation for further processing and
/// transformation into other formats. The raw representation captures the essential information about each command in
/// a straightforward and easy-to-work-with format, allowing for efficient manipulation and subsequent conversion to
/// other representations.
layer command;

/// Parser.
/// 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.
layer parser;
}
2 changes: 1 addition & 1 deletion module/move/wca/src/ca/tool/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
crate::mod_interface!
{

/// Format table
/// It takes a table of data and format it into a human-readable string
layer table;

}
4 changes: 1 addition & 3 deletions module/move/wca/src/ca/verifier/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ crate::mod_interface!
{
/// Represents a grammatically correct command with a phrase descriptor, a list of command subjects, and a set of command options..
layer command;
/// Converts from raw to executable.
/// Provides a set of tools for processing and validating input, extracting relevant information, and converting raw data into a standardized format.
layer verifier;
// /// Available types for arguments.
// layer types;
}
41 changes: 0 additions & 41 deletions module/move/wca/src/ca/verifier/verifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ pub( crate ) mod private
use wtools::{ error, error::Result, err };
use ca::help::private::{ HelpGeneratorOptions, LevelOfDetail, generate_help_content };

// TODO: Remove Clone
/// Converts a `ParsedCommand` to a `VerifiedCommand` by performing validation and type casting on values.
///
/// ```
Expand All @@ -33,47 +32,7 @@ pub( crate ) mod private
/// # }
/// ```
#[ derive( Debug, Clone ) ]
// #[ derive( Former ) ]
pub struct Verifier;
// qqq : delete on completion
// {
// // TODO: Make getters
// /// all available commands
// #[ setter( false ) ]
// pub commands : &'a Dictionary, // qqq : for Bohdan : <- introduce Dictionary for HashMap< String, Vec< Command > >
// }

// impl VerifierFormer
// {
// /// Insert a command to the commands list
// pub fn command( mut self, command : Command ) -> Self
// {
// let mut commands = self.storage.commands.unwrap_or_default();
//
// let command_variants = commands.entry( command.phrase.to_owned() ).or_insert_with( Vec::new );
// command_variants.push( command );
//
// self.storage.commands = Some( commands );
// self
// }
//
// /// Expands the list of commands with received commands
// pub fn commands< V >( mut self, commands : V ) -> Self
// where
// V : Into< Vec< Command > >
// {
// let mut self_commands = self.storage.commands.unwrap_or_default();
//
// for command in commands.into()
// {
// let command_variants = self_commands.entry( command.phrase.to_owned() ).or_insert_with( Vec::new );
// command_variants.push( command );
// }
//
// self.storage.commands = Some( self_commands );
// self
// }
// }

impl Verifier
{
Expand Down

0 comments on commit aa59cd7

Please sign in to comment.