Skip to content

Commit 9ecebfe

Browse files
committed
Style
1 parent 4094371 commit 9ecebfe

File tree

6 files changed

+30
-18
lines changed

6 files changed

+30
-18
lines changed

include/tao/json/internal/action.hpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#ifndef TAOCPP_JSON_INCLUDE_INTERNAL_ACTION_HPP
55
#define TAOCPP_JSON_INCLUDE_INTERNAL_ACTION_HPP
66

7-
#include "../external/pegtl/contrib/changes.hpp"
7+
#include "../external/pegtl/nothing.hpp"
88

99
#include "errors.hpp"
1010
#include "grammar.hpp"
@@ -18,7 +18,8 @@ namespace tao
1818
namespace internal
1919
{
2020
template< typename Rule >
21-
struct action : json_pegtl::nothing< Rule >
21+
struct action
22+
: json_pegtl::nothing< Rule >
2223
{
2324
};
2425

include/tao/json/internal/control.hpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,22 +21,26 @@ namespace tao
2121
namespace internal
2222
{
2323
template< typename Rule >
24-
struct control : errors< Rule >
24+
struct control
25+
: errors< Rule >
2526
{
2627
};
2728

2829
template<>
29-
struct control< rules::number > : json_pegtl::change_state< rules::number, number_state, errors >
30+
struct control< rules::number >
31+
: json_pegtl::change_state< rules::number, number_state, errors >
3032
{
3133
};
3234

3335
template<>
34-
struct control< rules::string::content > : json_pegtl::change_state_and_action< rules::string::content, string_state, unescape_action, errors >
36+
struct control< rules::string::content >
37+
: json_pegtl::change_state_and_action< rules::string::content, string_state, unescape_action, errors >
3538
{
3639
};
3740

3841
template<>
39-
struct control< rules::key::content > : json_pegtl::change_state_and_action< rules::key::content, key_state, unescape_action, errors >
42+
struct control< rules::key::content >
43+
: json_pegtl::change_state_and_action< rules::key::content, key_state, unescape_action, errors >
4044
{
4145
};
4246

include/tao/json/internal/errors.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ namespace tao
2727
{
2828
template< typename Rule >
2929
struct errors
30-
: public json_pegtl::normal< Rule >
30+
: json_pegtl::normal< Rule >
3131
{
3232
static const std::string error_message;
3333

include/tao/json/sax/from_stream.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ namespace tao
2222
template< typename Consumer >
2323
inline void from_stream( std::istream& stream, Consumer& consumer, const char* source = nullptr, const std::size_t maximum_buffer_size = 4000 )
2424
{
25-
json_pegtl::istream_input<> input( stream, maximum_buffer_size, source ? source : "tao::json::sax::from_stream" );
26-
json_pegtl::parse< internal::grammar, internal::action, internal::control >( input, consumer );
25+
json_pegtl::istream_input<> in( stream, maximum_buffer_size, source ? source : "tao::json::sax::from_stream" );
26+
json_pegtl::parse< internal::grammar, internal::action, internal::control >( in, consumer );
2727
}
2828

2929
template< typename Consumer >

include/tao/json/sax/from_string.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ namespace tao
2020
template< typename Consumer >
2121
inline void from_string( const char* data, const std::size_t size, Consumer& consumer, const char* source = nullptr, const std::size_t byte = 0, const std::size_t line = 1, const std::size_t column = 0 )
2222
{
23-
json_pegtl::memory_input< json_pegtl::tracking_mode::LAZY, json_pegtl::eol::lf_crlf, const char* > input( data, data + size, source ? source : "tao::json::sax::from_string", byte, line, column );
24-
json_pegtl::parse< internal::grammar, internal::action, internal::control >( input, consumer );
23+
json_pegtl::memory_input< json_pegtl::tracking_mode::LAZY, json_pegtl::eol::lf_crlf, const char* > in( data, data + size, source ? source : "tao::json::sax::from_string", byte, line, column );
24+
json_pegtl::parse< internal::grammar, internal::action, internal::control >( in, consumer );
2525
}
2626

2727
template< typename Consumer >

include/tao/json/schema.hpp

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,29 +32,36 @@ namespace tao
3232
namespace internal
3333
{
3434
// TODO: Check if these grammars are correct.
35-
struct local_part_label : json_pegtl::plus< json_pegtl::sor< json_pegtl::alnum, json_pegtl::one< '!', '#', '$', '%', '&', '\'', '*', '+', '-', '/', '=', '?', '^', '_', '`', '{', '|', '}', '~' > > >
35+
struct local_part_label
36+
: json_pegtl::plus< json_pegtl::sor< json_pegtl::alnum, json_pegtl::one< '!', '#', '$', '%', '&', '\'', '*', '+', '-', '/', '=', '?', '^', '_', '`', '{', '|', '}', '~' > > >
3637
{
3738
};
38-
struct local_part : json_pegtl::list_must< local_part_label, json_pegtl::one< '.' > >
39+
40+
struct local_part
41+
: json_pegtl::list_must< local_part_label, json_pegtl::one< '.' > >
3942
{
4043
};
4144

42-
struct hostname_label : json_pegtl::seq< json_pegtl::alnum, json_pegtl::rep_max< 62, json_pegtl::ranges< 'a', 'z', 'A', 'Z', '0', '9', '-' > > >
45+
struct hostname_label
46+
: json_pegtl::seq< json_pegtl::alnum, json_pegtl::rep_max< 62, json_pegtl::ranges< 'a', 'z', 'A', 'Z', '0', '9', '-' > > >
4347
{
4448
};
45-
struct hostname : json_pegtl::list_must< hostname_label, json_pegtl::one< '.' > >
49+
50+
struct hostname
51+
: json_pegtl::list_must< hostname_label, json_pegtl::one< '.' > >
4652
{
4753
};
4854

49-
struct email : json_pegtl::seq< local_part, json_pegtl::one< '@' >, hostname >
55+
struct email
56+
: json_pegtl::seq< local_part, json_pegtl::one< '@' >, hostname >
5057
{
5158
};
5259

5360
template< typename Rule >
5461
bool parse( const std::string& v )
5562
{
56-
json_pegtl::memory_input<> input( v, "" );
57-
return json_pegtl::parse< json_pegtl::seq< Rule, json_pegtl::eof > >( input );
63+
json_pegtl::memory_input<> in( v, "" );
64+
return json_pegtl::parse< json_pegtl::seq< Rule, json_pegtl::eof > >( in );
5865
}
5966

6067
inline bool parse_date_time( const std::string& v )

0 commit comments

Comments
 (0)