Skip to content

Commit

Permalink
Small fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
ColinH committed Mar 30, 2024
1 parent 7322fc2 commit 82f6621
Show file tree
Hide file tree
Showing 12 changed files with 15 additions and 19 deletions.
4 changes: 0 additions & 4 deletions include/tao/config/internal/config_parser.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions include/tao/config/internal/debug_traits.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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" );
}
};

Expand All @@ -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" );
Expand Down
2 changes: 1 addition & 1 deletion include/tao/config/internal/key1_action.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
Expand Down
4 changes: 2 additions & 2 deletions include/tao/config/internal/key1_grammar.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion include/tao/config/internal/key1_part.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
#define TAO_CONFIG_INTERNAL_KEY1_PART_HPP

#include <cassert>
#include <cstdint>
#include <cstddef>
#include <cstdint>
#include <memory>
#include <string>
#include <variant>
Expand Down
2 changes: 1 addition & 1 deletion include/tao/config/internal/phase1_append.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
}
Expand Down
4 changes: 2 additions & 2 deletions include/tao/config/internal/phase2_access.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
}
Expand All @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion include/tao/config/internal/phase2_additions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions include/tao/config/internal/phase2_asterisks.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion include/tao/config/internal/phase2_everything.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion include/tao/config/internal/phase3_remove.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
}
Expand Down
2 changes: 1 addition & 1 deletion include/tao/config/internal/statistics.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
#ifndef TAO_CONFIG_INTERNAL_STATISTICS_HPP
#define TAO_CONFIG_INTERNAL_STATISTICS_HPP

#include <cstdlib>
#include <cstddef>
#include <cstdlib>

#include "array.hpp"
#include "concat.hpp"
Expand Down

0 comments on commit 82f6621

Please sign in to comment.