Skip to content

Commit 916ad57

Browse files
committed
Switch to SAX parser
1 parent 203f20c commit 916ad57

File tree

14 files changed

+236
-354
lines changed

14 files changed

+236
-354
lines changed

include/tao/json/from_string.hh

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,11 @@
66

77
#include "external/pegtl/parse.hh"
88

9-
#include "internal/result_state.hh"
10-
#include "internal/control.hh"
9+
#include "internal/value_builder.hh"
10+
11+
#include "internal/grammar.hh"
12+
#include "internal/sax_action.hh"
13+
#include "internal/sax_control.hh"
1114

1215
namespace tao
1316
{
@@ -16,10 +19,10 @@ namespace tao
1619
template< template< typename ... > class Traits >
1720
inline basic_value< Traits > from_string( const char * data, const std::size_t size, const char * source = nullptr, const std::size_t line = 1, const std::size_t column = 0 )
1821
{
19-
internal::result_state< Traits > result;
22+
internal::value_builder< Traits > handler;
2023
tao_json_pegtl::input input( line, column, data, data + size, source ? source : __PRETTY_FUNCTION__ );
21-
tao_json_pegtl::parse_input< internal::grammar, tao_json_pegtl::nothing, internal::control_selector< Traits >::template control >( input, result );
22-
return std::move( result.result );
24+
tao_json_pegtl::parse_input< internal::grammar, internal::sax_action, internal::sax_control >( input, handler );
25+
return std::move( handler.value );
2326
}
2427

2528
template< template< typename ... > class Traits >

include/tao/json/internal/array_action.hh

Lines changed: 0 additions & 37 deletions
This file was deleted.

include/tao/json/internal/array_state.hh

Lines changed: 0 additions & 46 deletions
This file was deleted.

include/tao/json/internal/control.hh

Lines changed: 0 additions & 57 deletions
This file was deleted.

include/tao/json/internal/object_action.hh

Lines changed: 0 additions & 37 deletions
This file was deleted.

include/tao/json/internal/object_state.hh

Lines changed: 0 additions & 49 deletions
This file was deleted.

include/tao/json/internal/result_state.hh

Lines changed: 0 additions & 31 deletions
This file was deleted.

0 commit comments

Comments
 (0)