From 82f662185d4c2b3ccfdaf00089ead6cf9928dd18 Mon Sep 17 00:00:00 2001 From: "Dr. Colin Hirsch" Date: Sat, 30 Mar 2024 13:50:15 +0100 Subject: [PATCH] Small fixes. --- include/tao/config/internal/config_parser.hpp | 4 ---- include/tao/config/internal/debug_traits.hpp | 4 ++-- include/tao/config/internal/key1_action.hpp | 2 +- include/tao/config/internal/key1_grammar.hpp | 4 ++-- include/tao/config/internal/key1_part.hpp | 2 +- include/tao/config/internal/phase1_append.hpp | 2 +- include/tao/config/internal/phase2_access.hpp | 4 ++-- include/tao/config/internal/phase2_additions.hpp | 2 +- include/tao/config/internal/phase2_asterisks.hpp | 4 ++-- include/tao/config/internal/phase2_everything.hpp | 2 +- include/tao/config/internal/phase3_remove.hpp | 2 +- include/tao/config/internal/statistics.hpp | 2 +- 12 files changed, 15 insertions(+), 19 deletions(-) diff --git a/include/tao/config/internal/config_parser.hpp b/include/tao/config/internal/config_parser.hpp index 146d8d6..327c6f6 100644 --- a/include/tao/config/internal/config_parser.hpp +++ b/include/tao/config/internal/config_parser.hpp @@ -28,18 +28,14 @@ namespace tao::config::internal { config_parser() : fm( { { "binary", wrap( binary_function ) }, - // { "cbor", wrap( cbor_function ) }, { "default", wrap( default_function ) }, { "env", wrap( env_function ) }, { "env?", wrap( env_if_function ) }, { "jaxn", wrap( jaxn_function ) }, - // { "json", wrap( json_function ) }, - // { "msgpack", wrap( msgpack_function ) }, { "read", wrap( read_function ) }, { "shell", wrap( shell_function ) }, { "split", wrap( split_function ) }, { "string", wrap( string_function ) } } ) - //{ "ubjson", wrap( ubjson_function ) } } ) {} config_parser( config_parser&& ) = delete; diff --git a/include/tao/config/internal/debug_traits.hpp b/include/tao/config/internal/debug_traits.hpp index 6fc8c49..9c20db3 100644 --- a/include/tao/config/internal/debug_traits.hpp +++ b/include/tao/config/internal/debug_traits.hpp @@ -118,7 +118,7 @@ namespace tao::config::internal template< template< typename... > class Traits, typename Consumer > static void produce( Consumer& c, const part_asterisk_t /*unused*/ ) { - c.string( "star" ); + c.string( "asterisk" ); } }; @@ -138,7 +138,7 @@ namespace tao::config::internal c.string( "index" ); return; case key1_kind::asterisk: - c.string( "star" ); + c.string( "asterisk" ); return; case key1_kind::append: c.string( "append" ); diff --git a/include/tao/config/internal/key1_action.hpp b/include/tao/config/internal/key1_action.hpp index 85a2e06..aa823b8 100644 --- a/include/tao/config/internal/key1_action.hpp +++ b/include/tao/config/internal/key1_action.hpp @@ -42,7 +42,7 @@ namespace tao::config::internal }; template<> - struct key1_action< rules::star > + struct key1_action< rules::asterisk > { template< typename Input > static void apply( const Input& in, std::vector< key1_part >& st ) diff --git a/include/tao/config/internal/key1_grammar.hpp b/include/tao/config/internal/key1_grammar.hpp index a599209..85e09d2 100644 --- a/include/tao/config/internal/key1_grammar.hpp +++ b/include/tao/config/internal/key1_grammar.hpp @@ -10,9 +10,9 @@ namespace tao::config::internal::rules { // clang-format off - struct star : pegtl::one< '*' > {}; + struct asterisk : pegtl::one< '*' > {}; - struct key1_part : pegtl::sor< ident, quoted, index, star > {}; + struct key1_part : pegtl::sor< ident, quoted, index, asterisk > {}; struct key1_rule : pegtl::list_must< key1_part, dot > {}; // clang-format on diff --git a/include/tao/config/internal/key1_part.hpp b/include/tao/config/internal/key1_part.hpp index f297633..07a38ac 100644 --- a/include/tao/config/internal/key1_part.hpp +++ b/include/tao/config/internal/key1_part.hpp @@ -5,8 +5,8 @@ #define TAO_CONFIG_INTERNAL_KEY1_PART_HPP #include -#include #include +#include #include #include #include diff --git a/include/tao/config/internal/phase1_append.hpp b/include/tao/config/internal/phase1_append.hpp index dac11f1..7f3221e 100644 --- a/include/tao/config/internal/phase1_append.hpp +++ b/include/tao/config/internal/phase1_append.hpp @@ -70,7 +70,7 @@ namespace tao::config::internal case entry_kind::OBJECT: throw pegtl::parse_error( "cannot index (across) object", p ); case entry_kind::ASTERISK: - throw pegtl::parse_error( "cannot index (across) star", p ); + throw pegtl::parse_error( "cannot index (across) asterisk", p ); case entry_kind::REFERENCE: throw pegtl::parse_error( "cannot index (across) reference", p ); } diff --git a/include/tao/config/internal/phase2_access.hpp b/include/tao/config/internal/phase2_access.hpp index 7dab194..453ee12 100644 --- a/include/tao/config/internal/phase2_access.hpp +++ b/include/tao/config/internal/phase2_access.hpp @@ -105,7 +105,7 @@ namespace tao::config::internal if( down >= 0 ) { return nullptr; } - throw pegtl::parse_error( "cannot index (across) star", p ); + throw pegtl::parse_error( "cannot index (across) asterisk", p ); case entry_kind::REFERENCE: throw pegtl::parse_error( "cannot index (across) reference", p ); } @@ -116,7 +116,7 @@ namespace tao::config::internal { switch( p.kind() ) { case key1_kind::asterisk: - throw pegtl::parse_error( "unable to access star", p.position ); + throw pegtl::parse_error( "unable to access asterisk", p.position ); case key1_kind::name: return phase2_access_name( c, p.position, p.get_name(), suffix, down ); case key1_kind::index: diff --git a/include/tao/config/internal/phase2_additions.hpp b/include/tao/config/internal/phase2_additions.hpp index 18e0c40..f94c316 100644 --- a/include/tao/config/internal/phase2_additions.hpp +++ b/include/tao/config/internal/phase2_additions.hpp @@ -67,7 +67,7 @@ namespace tao::config::internal break; } } - else { // r->kind() == entry_kind::UNSIGNED + else { // r->kind() == entry_kind::UNSIGNED if( l->kind() == entry_kind::UNSIGNED ) { r->get_unsigned_atom().value += l->get_unsigned(); break; diff --git a/include/tao/config/internal/phase2_asterisks.hpp b/include/tao/config/internal/phase2_asterisks.hpp index 42606e5..3700e34 100644 --- a/include/tao/config/internal/phase2_asterisks.hpp +++ b/include/tao/config/internal/phase2_asterisks.hpp @@ -102,7 +102,7 @@ namespace tao::config::internal continue; case entry_kind::ARRAY: if( !j->get_array().function.empty() ) { - throw pegtl::parse_error( "please do not use a star inside of a function", j->get_array().position ); + throw pegtl::parse_error( "please do not use an asterisk inside of a function", j->get_array().position ); } process_array_concat_entry( j->get_array(), star ); continue; @@ -128,7 +128,7 @@ namespace tao::config::internal continue; case entry_kind::ARRAY: if( !j->get_array().function.empty() ) { - throw pegtl::parse_error( "please do not use a star inside of a function", j->get_array().position ); + throw pegtl::parse_error( "please do not use an asterisk inside of a function", j->get_array().position ); } process_concat_entry_array( star, j->get_array() ); continue; diff --git a/include/tao/config/internal/phase2_everything.hpp b/include/tao/config/internal/phase2_everything.hpp index 4a89724..f10aea4 100644 --- a/include/tao/config/internal/phase2_everything.hpp +++ b/include/tao/config/internal/phase2_everything.hpp @@ -5,8 +5,8 @@ #define TAO_CONFIG_INTERNAL_PHASE2_EVERYTHING_HPP #include "forward.hpp" -#include "phase2_asterisks.hpp" #include "phase2_additions.hpp" +#include "phase2_asterisks.hpp" #include "phase2_functions.hpp" #include "phase2_references.hpp" #include "state.hpp" diff --git a/include/tao/config/internal/phase3_remove.hpp b/include/tao/config/internal/phase3_remove.hpp index a6687d8..a10efa6 100644 --- a/include/tao/config/internal/phase3_remove.hpp +++ b/include/tao/config/internal/phase3_remove.hpp @@ -92,7 +92,7 @@ namespace tao::config::internal phase3_remove( e.get_object() ); continue; case entry_kind::ASTERISK: - throw pegtl::parse_error( "unresolved star", e.get_asterisk().position ); // Can happen when there are also unresolved references. + throw pegtl::parse_error( "unresolved asterisk", e.get_asterisk().position ); // Can happen when there are also unresolved references. case entry_kind::REFERENCE: throw pegtl::parse_error( "unresolved reference '" + e.get_reference().to_string() + '\'', e.get_reference().at( 0 ).position ); } diff --git a/include/tao/config/internal/statistics.hpp b/include/tao/config/internal/statistics.hpp index 1c0215c..a3df4eb 100644 --- a/include/tao/config/internal/statistics.hpp +++ b/include/tao/config/internal/statistics.hpp @@ -4,8 +4,8 @@ #ifndef TAO_CONFIG_INTERNAL_STATISTICS_HPP #define TAO_CONFIG_INTERNAL_STATISTICS_HPP -#include #include +#include #include "array.hpp" #include "concat.hpp"