Skip to content

Commit d979d53

Browse files
committed
wip
1 parent 13af65d commit d979d53

29 files changed

Lines changed: 139 additions & 159 deletions

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ c4_add_library(ryml
4444
c4/yml/common.cpp
4545
c4/yml/emit.def.hpp
4646
c4/yml/emit.hpp
47-
c4/yml/evt/event_handler_stack.hpp
48-
c4/yml/evt/event_handler_tree.hpp
47+
c4/yml/event_handler_stack.hpp
48+
c4/yml/event_handler_tree.hpp
4949
c4/yml/filter_processor.hpp
5050
c4/yml/fwd.hpp
5151
c4/yml/export.hpp

samples/quickstart.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -871,7 +871,7 @@ I am something: indeed
871871
// Getting the location of nodes in the source:
872872
//
873873
// Location tracking is opt-in:
874-
ryml::evt::EventHandlerTree evt_handler = {};
874+
ryml::EventHandlerTree evt_handler = {};
875875
ryml::Parser parser(&evt_handler, ryml::ParserOptions().locations(true));
876876
// Now the parser will start by building the accelerator structure:
877877
ryml::Tree tree2 = parse_in_arena(&parser, "expected.yml", expected_result);
@@ -2035,7 +2035,7 @@ bar2: [22,32]
20352035
* @see doc_parse */
20362036
void sample_parse_reuse_parser()
20372037
{
2038-
ryml::evt::EventHandlerTree evt_handler = {};
2038+
ryml::EventHandlerTree evt_handler = {};
20392039
ryml::Parser parser(&evt_handler);
20402040

20412041
// it is also advised to reserve the parser depth
@@ -2069,7 +2069,7 @@ void sample_parse_reuse_tree_and_parser()
20692069
// then reserve also the arena's size:
20702070
tree.reserve(256); // reserve 256 characters (good enough for this sample)
20712071

2072-
ryml::evt::EventHandlerTree evt_handler;
2072+
ryml::EventHandlerTree evt_handler;
20732073
ryml::Parser parser(&evt_handler);
20742074
// it is also advised to reserve the parser depth
20752075
// to the expected depth of the data tree:
@@ -4854,7 +4854,7 @@ void sample_global_allocator()
48544854

48554855
// verify that by reserving we save allocations
48564856
{
4857-
ryml::evt::EventHandlerTree evt_handler;
4857+
ryml::EventHandlerTree evt_handler;
48584858
ryml::Parser parser(&evt_handler); // reuse a parser
48594859
ryml::Tree tree; // reuse a tree
48604860

@@ -4960,7 +4960,7 @@ void sample_per_tree_allocator()
49604960
{
49614961
// Watchout: ensure that the lifetime of the callbacks target
49624962
// exceeds the lifetime of the tree.
4963-
ryml::evt::EventHandlerTree evt_handler(mrp.callbacks());
4963+
ryml::EventHandlerTree evt_handler(mrp.callbacks());
49644964
ryml::Parser parser(&evt_handler);
49654965
ryml::Tree tree1(mr1.callbacks());
49664966
ryml::Tree tree2(mr2.callbacks());
@@ -5022,7 +5022,7 @@ foo: [one, [two, three]]
50225022
// default.
50235023
ryml::ParserOptions opts = {};
50245024
opts.locations(true); // enable locations, default is false
5025-
ryml::evt::EventHandlerTree evt_handler = {};
5025+
ryml::EventHandlerTree evt_handler = {};
50265026
ryml::Parser parser(&evt_handler, opts);
50275027
CHECK(parser.options().locations());
50285028
// When locations are enabled, the first task while parsing will
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
#ifndef _C4_YML_EVT_EVENT_HANDLER_STACK_HPP_
2-
#define _C4_YML_EVT_EVENT_HANDLER_STACK_HPP_
1+
#ifndef _C4_YML_EVENT_HANDLER_STACK_HPP_
2+
#define _C4_YML_EVENT_HANDLER_STACK_HPP_
33

44
#ifndef _C4_YML_DETAIL_STACK_HPP_
55
#include "c4/yml/detail/stack.hpp"
@@ -191,4 +191,4 @@ struct EventHandlerStack
191191

192192
// NOLINTEND(hicpp-signed-bitwise)
193193

194-
#endif /* _C4_YML_EVT_EVENT_HANDLER_STACK_HPP_ */
194+
#endif /* _C4_YML_EVENT_HANDLER_STACK_HPP_ */
Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,19 @@
1-
#ifndef _C4_YML_EVT_EVENT_HANDLER_TREE_HPP_
2-
#define _C4_YML_EVT_EVENT_HANDLER_TREE_HPP_
1+
#ifndef _C4_YML_EVENT_HANDLER_TREE_HPP_
2+
#define _C4_YML_EVENT_HANDLER_TREE_HPP_
33

44
#ifndef _C4_YML_TREE_HPP_
55
#include "c4/yml/tree.hpp"
66
#endif
77

8-
#ifndef _C4_YML_EVT_EVENT_HANDLER_STACK_HPP_
9-
#include "c4/yml/evt/event_handler_stack.hpp"
8+
#ifndef _C4_YML_EVENT_HANDLER_STACK_HPP_
9+
#include "c4/yml/event_handler_stack.hpp"
1010
#endif
1111

1212
C4_SUPPRESS_WARNING_MSVC_WITH_PUSH(4702) // unreachable code
1313
// NOLINTBEGIN(hicpp-signed-bitwise)
1414

1515
namespace c4 {
1616
namespace yml {
17-
namespace evt {
1817

1918
/** @addtogroup doc_event_handlers
2019
* @{ */
@@ -761,7 +760,6 @@ struct EventHandlerTree : public EventHandlerStack<EventHandlerTree, EventHandle
761760

762761
/** @} */
763762

764-
} // namespace evt
765763
} // namespace yml
766764
} // namespace c4
767765

src/c4/yml/fwd.hpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,8 @@ class ConstNodeRef;
1515
class Tree;
1616
struct ReferenceResolver;
1717
template<class EventHandler> class ParseEngine;
18-
namespace evt {
1918
struct EventHandlerTree;
20-
} // namespace evt
21-
using Parser = ParseEngine<evt::EventHandlerTree>;
19+
using Parser = ParseEngine<EventHandlerTree>;
2220

2321
} // namespace c4
2422
} // namespace yml

src/c4/yml/parse.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
#ifndef _C4_YML_PARSE_ENGINE_DEF_HPP_
1010
#include "c4/yml/parse_engine.def.hpp"
1111
#endif
12-
#ifndef _C4_YML_EVT_EVENT_HANDLER_TREE_HPP_
13-
#include "c4/yml/evt/event_handler_tree.hpp"
12+
#ifndef _C4_YML_EVENT_HANDLER_TREE_HPP_
13+
#include "c4/yml/event_handler_tree.hpp"
1414
#endif
1515

1616

@@ -20,7 +20,7 @@ namespace c4 {
2020
namespace yml {
2121

2222
// instantiate the parser class
23-
template class ParseEngine<evt::EventHandlerTree>;
23+
template class ParseEngine<EventHandlerTree>;
2424

2525
namespace {
2626
inline void _reset_tree_handler(Parser *parser, Tree *t, id_type node_id)

src/c4/yml/parse.hpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@ namespace yml {
1111
class Tree;
1212
class NodeRef;
1313
template<class EventHandler> class ParseEngine;
14-
namespace evt {
1514
struct EventHandlerTree;
16-
} // namespace evt;
1715
RYML_EXPORT id_type estimate_tree_capacity(csubstr src); // NOLINT
1816

1917

@@ -33,7 +31,7 @@ RYML_EXPORT id_type estimate_tree_capacity(csubstr src); // NOLINT
3331
* @see ParseEngine
3432
* @see EventHandlerTree
3533
* */
36-
using Parser = RYML_EXPORT ParseEngine<evt::EventHandlerTree>;
34+
using Parser = RYML_EXPORT ParseEngine<EventHandlerTree>;
3735

3836

3937
//-----------------------------------------------------------------------------

src/c4/yml/tree.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1806,7 +1806,7 @@ Tree::_lookup_path_token Tree::_next_token(lookup_result *r, _lookup_path_token
18061806
//-----------------------------------------------------------------------------
18071807
//-----------------------------------------------------------------------------
18081808

1809-
#include "c4/yml/evt/event_handler_tree.hpp"
1809+
#include "c4/yml/event_handler_tree.hpp"
18101810
#include "c4/yml/parse_engine.def.hpp"
18111811
#include "c4/yml/parse.hpp"
18121812

src/c4/yml/yml.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#include "c4/yml/tree.hpp"
66
#include "c4/yml/node.hpp"
77
#include "c4/yml/emit.hpp"
8-
#include "c4/yml/evt/event_handler_tree.hpp"
8+
#include "c4/yml/event_handler_tree.hpp"
99
#include "c4/yml/parse_engine.hpp"
1010
#include "c4/yml/filter_processor.hpp"
1111
#include "c4/yml/parse.hpp"
Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
1-
#include "./event_handler_ints.hpp"
1+
#include "c4/yml/extra/event_handler_ints.hpp"
22
#include <c4/yml/parse_engine.def.hpp>
33

44
namespace c4 {
55
namespace yml {
6-
namespace evt {
76
namespace extra {
8-
97
} // namespace extra
10-
} // namespace evt
118

129
// instantiate the template
13-
template class ParseEngine<evt::extra::EventHandlerInts>;
10+
template class ParseEngine<extra::EventHandlerInts>;
1411

1512
} // namespace yml
1613
} // namespace c4

0 commit comments

Comments
 (0)