1 #ifndef _C4_YML_EVENT_HANDLER_TREE_HPP_
2 #define _C4_YML_EVENT_HANDLER_TREE_HPP_
4 #ifndef _C4_YML_TREE_HPP_
8 #ifndef _C4_YML_EVENT_HANDLER_STACK_HPP_
12 C4_SUPPRESS_WARNING_MSVC_WITH_PUSH(4702)
23 struct EventHandlerTreeState :
public ParserState
39 using state = EventHandlerTreeState;
46 Tree *C4_RESTRICT m_tree;
48 size_t m_num_directives;
49 bool m_yaml_directive;
52 #define _enable_(bits) _enable__<bits>(); _c4dbgpf("node[{}]: enable {}", m_curr->node_id, #bits)
53 #define _disable_(bits) _disable__<bits>(); _c4dbgpf("node[{}]: disable {}", m_curr->node_id, #bits)
55 #define _enable_(bits) _enable__<bits>()
56 #define _disable_(bits) _disable__<bits>()
58 #define _has_any_(bits) _has_any__<bits>()
75 if(C4_UNLIKELY(!tree))
76 _RYML_ERR_BASIC_(m_stack.m_callbacks,
"null tree");
77 if(C4_UNLIKELY(
id >= tree->
capacity()))
78 _RYML_ERR_BASIC_(tree->
callbacks(),
"invalid node");
79 if(C4_UNLIKELY(!tree->
is_root(
id)))
81 if(C4_UNLIKELY(!tree->
has_key(
id)))
82 _RYML_ERR_BASIC_(tree->
callbacks(),
"destination node belongs to a map and has no key");
85 if(m_tree->is_root(
id))
88 _reset_parser_state(m_curr,
id, m_tree->root_id());
92 _stack_reset_non_root();
93 _reset_parser_state(m_parent,
id, m_tree->parent(
id));
94 _reset_parser_state(m_curr,
id,
id);
97 m_yaml_directive =
false;
110 _RYML_ASSERT_BASIC_(m_stack.m_callbacks, m_tree !=
nullptr);
111 this->_stack_start_parse(filename, ymlsrc, relocate_arena, relocate_arena_data);
116 _RYML_ASSERT_BASIC_(m_stack.m_callbacks, m_tree !=
nullptr);
117 if(m_num_directives && !m_tree->is_stream(m_tree->root_id()))
118 _RYML_ERR_BASIC_(m_stack.m_callbacks,
"directives cannot be used without a document");
119 this->_stack_finish_parse();
161 _c4dbgp(
"begin_doc");
162 if(_stack_should_push_on_begin_doc())
165 _set_root_as_stream();
174 if(_stack_should_pop_on_end_doc())
176 _remove_speculative();
185 _c4dbgp(
"begin_doc_expl");
186 _RYML_ASSERT_VISIT_(m_stack.m_callbacks, m_tree->root_id() == m_curr->node_id, m_tree, m_curr->node_id);
187 if(!m_tree->is_stream(m_tree->root_id()))
189 _c4dbgp(
"ensure stream");
190 _set_root_as_stream();
191 const id_type root = m_tree->root_id();
192 const id_type first = m_tree->first_child(root);
193 _RYML_ASSERT_VISIT_(m_stack.m_callbacks, m_tree->is_stream(root), m_tree, root);
194 _RYML_ASSERT_VISIT_(m_stack.m_callbacks, m_tree->num_children(root) == 1u, m_tree, root);
195 if(m_tree->is_container(first) || m_tree->is_val(first))
199 #ifdef RYML_WITH_COMMENTS
200 m_tree->_p(root)->m_first_comment =
NONE;
201 m_tree->_p(root)->m_last_comment =
NONE;
208 _remove_speculative();
209 m_curr->node_id = m_tree->last_child(root);
210 m_curr->tr_data = m_tree->_p(m_curr->node_id);
223 _c4dbgp(
"end_doc_expl");
224 _remove_speculative();
225 if(_stack_should_pop_on_end_doc())
230 m_yaml_directive =
false;
242 _RYML_ERR_PARSE_(m_stack.m_callbacks, m_curr->pos,
"ryml trees cannot handle containers as keys");
246 _RYML_ERR_PARSE_(m_stack.m_callbacks, m_curr->pos,
"ryml trees cannot handle containers as keys");
251 _c4dbgpf(
"node[{}]: begin_map_val_flow", m_curr->node_id);
252 _RYML_CHECK_BASIC_(m_stack.m_callbacks, !
_has_any_(
VAL));
259 _c4dbgpf(
"node[{}]: begin_map_val_block", m_curr->node_id);
260 _RYML_CHECK_BASIC_(m_stack.m_callbacks, !
_has_any_(
VAL));
268 _c4dbgpf(
"node[{}]: end_map_block", m_parent->node_id, m_parent->pos.line, m_curr->pos.line);
274 _c4dbgpf(
"node[{}]: end_map. multiline={} startline={} endline={}", m_parent->node_id, multiline, m_parent->pos.line, m_curr->pos.line);
292 _RYML_ERR_PARSE_(m_stack.m_callbacks, m_curr->pos,
"ryml trees cannot handle containers as keys");
296 _RYML_ERR_PARSE_(m_stack.m_callbacks, m_curr->pos,
"ryml trees cannot handle containers as keys");
301 _c4dbgpf(
"node[{}]: begin_seq_val_flow", m_curr->node_id);
302 _RYML_CHECK_BASIC_(m_stack.m_callbacks, !
_has_any_(
VAL));
309 _c4dbgpf(
"node[{}]: begin_seq_val_block", m_curr->node_id);
310 _RYML_CHECK_BASIC_(m_stack.m_callbacks, !
_has_any_(
VAL));
318 _c4dbgpf(
"node[{}]: end_seq_block", m_parent->node_id, m_parent->pos.line, m_curr->pos.line);
324 _c4dbgpf(
"node[{}]: end_seq. multiline={} startline={} endline={}", m_parent->node_id, multiline, m_parent->pos.line, m_curr->pos.line);
342 _RYML_ASSERT_BASIC_(m_stack.m_callbacks, m_tree);
343 _RYML_ASSERT_BASIC_(m_stack.m_callbacks, m_parent);
344 _RYML_ASSERT_VISIT_(m_stack.m_callbacks, m_tree->has_children(m_parent->node_id), m_tree, m_parent->node_id);
345 NodeData const*
const prev = m_tree->m_buf;
346 _set_state_(m_curr, m_tree->_append_child__unprotected(m_parent->node_id));
347 if(prev != m_tree->m_buf)
348 _refresh_after_relocation();
349 _c4dbgpf(
"node[{}]: added sibling={} prev={}", m_parent->node_id, m_curr->node_id, m_tree->prev_sibling(m_curr->node_id));
359 if(C4_UNLIKELY(m_tree->is_container(m_curr->node_id)))
360 _RYML_ERR_PARSE_(m_stack.m_callbacks, m_curr->pos,
"ryml trees cannot handle containers as keys");
361 _RYML_ASSERT_BASIC_(m_stack.m_callbacks, m_parent);
362 _RYML_ASSERT_VISIT_(m_stack.m_callbacks, m_tree->is_seq(m_parent->node_id), m_tree, m_parent->node_id);
363 _RYML_ASSERT_VISIT_(m_stack.m_callbacks, !m_tree->is_container(m_curr->node_id), m_tree, m_curr->node_id);
364 _RYML_ASSERT_VISIT_(m_stack.m_callbacks, !m_tree->has_key(m_curr->node_id), m_tree, m_curr->node_id);
365 const NodeData tmp = _val2key_(*m_curr->tr_data);
367 m_curr->tr_data->m_val = {};
368 begin_map_val_flow();
369 m_curr->tr_data->m_type = tmp.
m_type;
370 m_curr->tr_data->m_key = tmp.
m_key;
381 _RYML_ERR_PARSE_(m_stack.m_callbacks, m_curr->pos,
"ryml trees cannot handle containers as keys");
394 _c4dbgpf(
"node[{}]: set key scalar plain as empty", m_curr->node_id);
395 m_curr->tr_data->m_key.scalar = {};
400 _c4dbgpf(
"node[{}]: set val scalar plain as empty", m_curr->node_id);
401 m_curr->tr_data->m_val.scalar = {};
407 _c4dbgpf(
"node[{}]: set key scalar plain: [{}]~~~{}~~~", m_curr->node_id, scalar.len, scalar);
408 m_curr->tr_data->m_key.scalar = scalar;
413 _c4dbgpf(
"node[{}]: set val scalar plain: [{}]~~~{}~~~", m_curr->node_id, scalar.len, scalar);
414 m_curr->tr_data->m_val.scalar = scalar;
421 _c4dbgpf(
"node[{}]: set key scalar dquot: [{}]~~~{}~~~", m_curr->node_id, scalar.len, scalar);
422 m_curr->tr_data->m_key.scalar = scalar;
427 _c4dbgpf(
"node[{}]: set val scalar dquot: [{}]~~~{}~~~", m_curr->node_id, scalar.len, scalar);
428 m_curr->tr_data->m_val.scalar = scalar;
435 _c4dbgpf(
"node[{}]: set key scalar squot: [{}]~~~{}~~~", m_curr->node_id, scalar.len, scalar);
436 m_curr->tr_data->m_key.scalar = scalar;
441 _c4dbgpf(
"node[{}]: set val scalar squot: [{}]~~~{}~~~", m_curr->node_id, scalar.len, scalar);
442 m_curr->tr_data->m_val.scalar = scalar;
449 _c4dbgpf(
"node[{}]: set key scalar literal: [{}]~~~{}~~~", m_curr->node_id, scalar.len, scalar);
450 m_curr->tr_data->m_key.scalar = scalar;
455 _c4dbgpf(
"node[{}]: set val scalar literal: [{}]~~~{}~~~", m_curr->node_id, scalar.len, scalar);
456 m_curr->tr_data->m_val.scalar = scalar;
463 _c4dbgpf(
"node[{}]: set key scalar folded: [{}]~~~{}~~~", m_curr->node_id, scalar.len, scalar);
464 m_curr->tr_data->m_key.scalar = scalar;
469 _c4dbgpf(
"node[{}]: set val scalar folded: [{}]~~~{}~~~", m_curr->node_id, scalar.len, scalar);
470 m_curr->tr_data->m_val.scalar = scalar;
493 _c4dbgpf(
"node[{}]: set key anchor: [{}]~~~{}~~~", m_curr->node_id, anchor.len, anchor);
494 _RYML_ASSERT_BASIC_(m_stack.m_callbacks, m_tree);
496 _RYML_ASSERT_PARSE_(m_tree->callbacks(), !anchor.begins_with(
'&'), m_curr->pos);
498 m_curr->tr_data->m_key.anchor = anchor;
502 _c4dbgpf(
"node[{}]: set val anchor: [{}]~~~{}~~~", m_curr->node_id, anchor.len, anchor);
503 _RYML_ASSERT_BASIC_(m_stack.m_callbacks, m_tree);
505 _RYML_ASSERT_PARSE_(m_tree->callbacks(), !anchor.begins_with(
'&'), m_curr->pos);
507 m_curr->tr_data->m_val.anchor = anchor;
512 _c4dbgpf(
"node[{}]: set key ref: [{}]~~~{}~~~", m_curr->node_id, ref.len, ref);
513 _RYML_ASSERT_BASIC_(m_stack.m_callbacks, m_tree);
515 _RYML_ERR_PARSE_(m_tree->callbacks(), m_curr->pos,
"key cannot have both anchor and ref");
516 _RYML_ASSERT_PARSE_(m_tree->callbacks(), ref.begins_with(
'*'), m_curr->pos);
518 m_curr->tr_data->m_key.anchor = ref.sub(1);
519 m_curr->tr_data->m_key.scalar = ref;
523 _c4dbgpf(
"node[{}]: set val ref: [{}]~~~{}~~~", m_curr->node_id, ref.len, ref);
524 _RYML_ASSERT_BASIC_(m_stack.m_callbacks, m_tree);
526 _RYML_ERR_PARSE_(m_tree->callbacks(), m_curr->pos,
"val cannot have both anchor and ref");
527 _RYML_ASSERT_PARSE_(m_tree->callbacks(), ref.begins_with(
'*'), m_curr->pos);
529 m_curr->tr_data->m_val.anchor = ref.sub(1);
530 m_curr->tr_data->m_val.scalar = ref;
542 _c4dbgpf(
"node[{}]: set key tag: [{}]~~~{}~~~", m_curr->node_id, tag.len, tag);
544 m_curr->tr_data->m_key.tag = tag;
548 _c4dbgpf(
"node[{}]: set val tag: [{}]~~~{}~~~", m_curr->node_id, tag.len, tag);
550 m_curr->tr_data->m_val.tag = tag;
562 _c4dbgpf(
"% directive! {}", directive);
563 _RYML_ASSERT_PARSE_(m_tree->callbacks(), directive.begins_with(
'%'), m_curr->pos);
564 if(directive.begins_with(
"%TAG"))
566 if(C4_UNLIKELY(!m_tree->add_tag_directive(directive)))
567 _RYML_ERR_PARSE_(m_stack.m_callbacks, m_curr->pos,
"failed to add directive");
569 else if(directive.begins_with(
"%YAML"))
571 _c4dbgpf(
"%YAML directive! ignoring...: {}", directive);
572 if(C4_UNLIKELY(m_yaml_directive))
573 _RYML_ERR_PARSE_(m_stack.m_callbacks, m_curr->pos,
"multiple yaml directives");
574 m_yaml_directive =
true;
578 _c4dbgpf(
"unknown directive! ignoring... {}", directive);
592 _RYML_ASSERT_BASIC_(m_stack.m_callbacks, m_tree);
593 csubstr prev = m_tree->arena();
594 substr out = m_tree->alloc_arena(len);
595 substr curr = m_tree->arena();
596 if(curr.str != prev.str)
597 _stack_relocate_to_new_arena(prev, curr);
603 _RYML_ASSERT_BASIC_(m_stack.m_callbacks, m_tree);
604 csubstr prev = m_tree->arena();
605 if(!prev.is_super(*relocated))
606 return alloc_arena(len);
607 substr out = alloc_arena(len);
608 substr curr = m_tree->arena();
609 if(curr.str != prev.str)
610 *relocated = _stack_relocate_to_new_arena(*relocated, prev, curr);
619 void _reset_parser_state(state* st,
id_type parse_root,
id_type node)
621 _RYML_ASSERT_BASIC_(m_stack.m_callbacks, m_tree);
622 _set_state_(st, node);
626 _c4dbgpf(
"resetting state: initial flags={}", detail::_parser_flags_to_str(flagbuf, st->flags));
630 _c4dbgpf(
"node[{}] is notype", node);
631 if(m_tree->is_root(parse_root))
633 _c4dbgpf(
"node[{}] is root", node);
638 _c4dbgpf(
"node[{}] is not root. setting USTY", node);
644 _c4dbgpf(
"node[{}] is map", node);
649 _c4dbgpf(
"node[{}] is map", node);
654 _c4dbgpf(
"node[{}] has key. setting USTY", node);
659 _RYML_ERR_VISIT_(m_tree->callbacks(), m_tree, node,
"cannot append to node");
663 _c4dbgpf(
"node[{}] is doc", node);
667 _c4dbgpf(
"resetting state: final flags={}", detail::_parser_flags_to_str(flagbuf, st->flags));
676 NodeData
const* prev = m_tree->m_buf;
677 m_curr->node_id = m_tree->_append_child__unprotected(m_parent->node_id);
678 m_curr->tr_data = m_tree->_p(m_curr->node_id);
679 if(prev != m_tree->m_buf)
680 _refresh_after_relocation();
681 _c4dbgpf(
"pushed! level={}. top is now node={} (parent={})", m_curr->level, m_curr->node_id, m_parent ? m_parent->node_id :
NONE);
686 _remove_speculative_with_parent();
692 template<type_bits bits> C4_HOT C4_ALWAYS_INLINE
void _enable__() noexcept
694 m_curr->tr_data->m_type.type =
static_cast<NodeType_e>(m_curr->tr_data->m_type.type | bits);
696 template<type_bits bits> C4_HOT C4_ALWAYS_INLINE
void _disable__() noexcept
698 m_curr->tr_data->m_type.type =
static_cast<NodeType_e>(m_curr->tr_data->m_type.type & (~bits));
700 template<type_bits bits> C4_HOT C4_ALWAYS_INLINE
bool _has_any__() const noexcept
702 return (m_curr->tr_data->m_type.type & bits) != 0;
707 C4_ALWAYS_INLINE
void _set_state_(state *C4_RESTRICT s,
id_type id)
const noexcept
710 s->tr_data = m_tree->_p(
id);
712 void _refresh_after_relocation()
714 _c4dbgp(
"tree: refreshing stack data after tree data relocation");
715 for(
auto &st : m_stack)
716 st.tr_data = m_tree->_p(st.node_id);
719 void _set_root_as_stream()
721 _c4dbgp(
"set root as stream");
722 _RYML_ASSERT_VISIT_(m_tree->callbacks(), m_tree->root_id() == 0u, m_tree, m_tree->root_id());
723 _RYML_ASSERT_VISIT_(m_tree->callbacks(), m_curr->node_id == 0u, m_tree, m_curr->node_id);
724 m_tree->set_root_as_stream();
725 _RYML_ASSERT_VISIT_(m_tree->callbacks(), m_tree->is_stream(m_tree->root_id()), m_tree, m_tree->root_id());
726 _RYML_ASSERT_VISIT_(m_tree->callbacks(), m_tree->has_children(m_tree->root_id()), m_tree, m_tree->root_id());
727 _RYML_ASSERT_VISIT_(m_tree->callbacks(), m_tree->is_doc(m_tree->first_child(m_tree->root_id())), m_tree, m_tree->root_id());
728 _set_state_(m_curr, m_tree->root_id());
731 static NodeData _val2key_(NodeData
const& C4_RESTRICT d) noexcept
737 static_assert((
_VALMASK >> 1u) ==
_KEYMASK,
"required for this function to work");
741 r.m_type.type = (r.m_type.type |
KEY);
742 if(d.m_type.type &
VALNIL)
743 r.m_type.type = (r.m_type.type |
KEYNIL);
747 void _remove_speculative()
749 _c4dbgp(
"remove speculative node");
750 _RYML_ASSERT_BASIC_(m_stack.m_callbacks, m_tree);
751 _RYML_ASSERT_BASIC_(m_tree->callbacks(), !m_tree->empty());
752 const id_type last_added = m_tree->size() - 1;
753 if(m_tree->has_parent(last_added))
754 if(m_tree->_p(last_added)->m_type ==
NOTYPE)
755 m_tree->remove(last_added);
758 void _remove_speculative_with_parent()
760 _RYML_ASSERT_BASIC_(m_stack.m_callbacks, m_tree);
761 _RYML_ASSERT_BASIC_(m_tree->callbacks(), !m_tree->empty());
762 const id_type last_added = m_tree->size() - 1;
763 _RYML_ASSERT_VISIT_(m_tree->callbacks(), m_tree->has_parent(last_added), m_tree, last_added);
764 if(m_tree->_p(last_added)->m_type ==
NOTYPE)
766 _c4dbgpf(
"remove speculative node with parent. parent={} node={} parent(node)={}", m_parent->node_id, last_added, m_tree->parent(last_added));
767 m_tree->remove(last_added);
771 C4_ALWAYS_INLINE
void _save_loc()
773 _RYML_ASSERT_BASIC_(m_stack.m_callbacks, m_tree);
774 _RYML_ASSERT_BASIC_(m_tree->callbacks(), m_tree->_p(m_curr->node_id)->m_val.scalar.len == 0);
775 m_tree->_p(m_curr->node_id)->m_val.scalar.str = m_curr->line_contents.rem.str;
791 C4_SUPPRESS_WARNING_MSVC_POP
bool is_map(id_type node) const
bool is_root(id_type node) const
bool has_key(id_type node) const
id_type parent(id_type node) const
Callbacks const & callbacks() const
NodeType_e
a bit mask for marking node types and styles
@ VALANCH
the val has an &anchor
@ NOTYPE
no node type or style is set
@ KEY_DQUO
mark key scalar as double quoted "
@ VALREF
a *reference: the val references an &anchor
@ VALNIL
the val is null (eg {a : } results in a null val)
@ MAP
a map: a parent of KEYVAL/KEYSEQ/KEYMAP nodes
@ VAL_FOLDED
mark val scalar as multiline, block folded >
@ VAL_STYLE
mask of all the scalar styles for val (not container styles!)
@ KEYTAG
the key has a tag
@ FLOW_SL
mark container with single-line flow style (seqs as '[val1,val2], maps as '{key: val,...
@ FLOW_ML
mark container with multi-line flow style (seqs as '[ val1, val2 ], maps as '{ key: val,...
@ VAL_UNFILT
the val scalar was left unfiltered; the parser was set not to filter.
@ VAL
a scalar: has a scalar (ie string) value, possibly empty. must be a leaf node, and cannot be MAP or S...
@ VALTAG
the val has a tag
@ SEQ
a seq: a parent of VAL/SEQ/MAP nodes
@ VAL_SQUO
mark val scalar as single quoted '
@ KEY_STYLE
mask of all the scalar styles for key (not container styles!)
@ VAL_PLAIN
mark val scalar as plain scalar (unquoted, even when multiline)
@ KEYREF
a *reference: the key references an &anchor
@ BLOCK
mark container with block style (seqs as '- val ', maps as 'key: val')
@ KEYANCH
the key has an &anchor
@ VAL_DQUO
mark val scalar as double quoted "
@ KEY_UNFILT
the key scalar was left unfiltered; the parser was set not to filter.
@ KEY_SQUO
mark key scalar as single quoted '
@ VAL_LITERAL
mark val scalar as multiline, block literal |
@ KEY_LITERAL
mark key scalar as multiline, block literal |
@ KEY_PLAIN
mark key scalar as plain scalar (unquoted, even when multiline)
@ KEY_FOLDED
mark key scalar as multiline, block folded >
@ KEYNIL
the key is null (eg { : b} results in a null key)
void(*)(void *, csubstr prev_arena, substr next_arena) pfn_relocate_arena
RYML_ID_TYPE id_type
The type of a node id in the YAML tree; to override the default type, define the macro RYML_ID_TYPE t...
@ RTOP
reading at top level
@ RUNK
reading unknown state (when starting): must determine whether scalar, map or seq
@ USTY
reading in unknown style mode - must determine FLOW or BLCK reading an implicit map nested in an expl...
(Undefined by default) Use shorter error message from checks/asserts: do not show the check condition...
A c-style callbacks class to customize behavior on errors or allocation.
Use this class a base of implementations of event handler to simplify the stack logic.
The event handler to create a ryml Tree.
void set_key_scalar_plain(csubstr scalar) noexcept
void set_val_tag(csubstr tag) noexcept
void mark_val_scalar_unfiltered() noexcept
void end_doc_expl()
explicit doc end, with ...
void end_seq_flow(bool multiline)
void begin_map_key_flow()
void end_doc()
implicit doc end (without ...)
EventHandlerTreeState state
void begin_doc()
implicit doc start (without —)
void set_val_scalar_plain(csubstr scalar) noexcept
void set_key_scalar_plain_empty() noexcept
EventHandlerTree(Callbacks const &cb)
void mark_key_scalar_unfiltered() noexcept
void actually_val_is_first_key_of_new_map_block()
like its flow counterpart, but this function can only be called after the end of a flow-val at root o...
void set_val_scalar_folded(csubstr scalar) noexcept
Callbacks const & callbacks() const
void begin_doc_expl()
explicit doc start, with —
void add_directive(csubstr directive)
void begin_map_val_flow()
void end_stream() const noexcept
void start_parse(const char *filename, csubstr ymlsrc, detail::pfn_relocate_arena relocate_arena, void *relocate_arena_data)
void set_val_scalar_dquoted(csubstr scalar) noexcept
void begin_seq_val_flow()
void set_val_scalar_plain_empty() noexcept
void begin_map_key_block()
substr alloc_arena(size_t len, substr *relocated)
void begin_seq_key_block()
void end_map_flow(bool multiline)
void begin_map_val_block()
void begin_seq_val_block()
void set_val_scalar_squoted(csubstr scalar) noexcept
void set_val_ref(csubstr ref)
void set_key_ref(csubstr ref)
void reset(Tree *tree, id_type id)
void set_val_anchor(csubstr anchor)
void set_key_scalar_literal(csubstr scalar) noexcept
void actually_val_is_first_key_of_new_map_flow()
reset the previous val as the first key of a new map, with flow style.
EventHandlerTree(Tree *tree, id_type id)
void begin_seq_key_flow()
void set_key_tag(csubstr tag) noexcept
void set_key_scalar_folded(csubstr scalar) noexcept
void begin_stream() const noexcept
void set_key_anchor(csubstr anchor)
substr alloc_arena(size_t len)
void set_key_scalar_dquoted(csubstr scalar) noexcept
void set_val_scalar_literal(csubstr scalar) noexcept
void set_key_scalar_squoted(csubstr scalar) noexcept
contains the data for each YAML node.
wraps a NodeType_e element with some syntactic sugar and predicates
bool has_key() const noexcept
bool is_doc() const noexcept
bool is_seq() const noexcept
bool is_map() const noexcept