@@ -4327,7 +4327,7 @@ void ParseEngine<EventHandler>::_add_annotation(Annotation *C4_RESTRICT dst, csu
43274327template <class EventHandler >
43284328void ParseEngine<EventHandler>::_add_annotation(Annotation *C4_RESTRICT dst, csubstr str, size_t indentation, size_t line)
43294329{
4330- _c4dbgpf (" store annotation[{}]: '{}' indentation={} line={}" , dst->num_entries , str. str ? str : csubstr ( " (arena full) " ), indentation, line);
4330+ _c4dbgpf (" store annotation[{}]: '{}' indentation={} line={}" , dst->num_entries , _maybe_null_str (str ), indentation, line);
43314331 _RYML_ASSERT_PARSE_ (m_evt_handler->m_stack .m_callbacks , dst->num_entries < C4_COUNTOF (dst->annotations ), m_evt_handler->m_curr ->pos ); // NOLINT(bugprone-sizeof-expression)
43324332 if (C4_UNLIKELY (dst->num_entries && dst->annotations [0 ].line == line))
43334333 {
@@ -4343,7 +4343,7 @@ void ParseEngine<EventHandler>::_add_annotation(Annotation *C4_RESTRICT dst, csu
43434343template <class EventHandler >
43444344void ParseEngine<EventHandler>::_add_annotation(Annotation *C4_RESTRICT dst, csubstr str, size_t indentation, size_t line, csubstr orig)
43454345{
4346- _c4dbgpf (" store annotation[{}]: '{}'->'{}' indentation={} line={}" , dst->num_entries , orig, str. str ? str : csubstr ( " (arena full) " ), indentation, line);
4346+ _c4dbgpf (" store annotation[{}]: '{}'->'{}' indentation={} line={}" , dst->num_entries , orig, _maybe_null_str (str ), indentation, line);
43474347 _RYML_ASSERT_PARSE_ (m_evt_handler->m_stack .m_callbacks , dst->num_entries < C4_COUNTOF (dst->annotations ), m_evt_handler->m_curr ->pos ); // NOLINT(bugprone-sizeof-expression)
43484348 if (C4_UNLIKELY (dst->num_entries && dst->annotations [0 ].line == line))
43494349 {
@@ -4677,7 +4677,7 @@ csubstr ParseEngine<EventHandler>::_resolve_tag(csubstr tag)
46774677 _c4assert (!ttag.str || ttag.is_sub (m_evt_handler->arena ()));
46784678 }
46794679 }
4680- _c4dbgpf (" resolved tag: {} --> [{}]~~~{}~~~" , _prs (tag), ttag.len , ttag. str ? ttag : csubstr ( " (out of size) " ));
4680+ _c4dbgpf (" resolved tag: {} --> [{}]~~~{}~~~" , _prs (tag), ttag.len , _maybe_null_str (ttag ));
46814681 _c4assert (ttag.len > 0 );
46824682 // cache the hard-earned result!
46834683 m_evt_handler->tag_cache ().add (tag, ttag, m_evt_handler->m_curr_doc , ret.pos );
@@ -8261,7 +8261,7 @@ uint32_t ParseEngine<EventHandler>::_get_annotations_same_line(csubstr token_sou
82618261 {
82628262 _c4dbgpf (" there are {} pending annotations: {} anchors + {} tags" , total, m_pending_anchors.num_entries , m_pending_tags.num_entries );
82638263 auto valid_if_same_line = [this ](EntryPtr entry){
8264- _c4dbgpf (" pending: {} indent={} line={} vs currline={}" , entry->str , entry->indentation , entry->line , m_evt_handler->m_curr ->pos .line );
8264+ _c4dbgpf (" pending: {} indent={} line={} vs currline={}" , _maybe_null_str ( entry->str ) , entry->indentation , entry->line , m_evt_handler->m_curr ->pos .line );
82658265 return (entry->line == m_evt_handler->m_curr ->pos .line ) ? entry : nullptr ;
82668266 };
82678267 // now select annotations only on the same line
@@ -8290,14 +8290,14 @@ uint32_t ParseEngine<EventHandler>::_get_annotations_same_line(csubstr token_sou
82908290 // assign to first
82918291 first = get_first_on_same_line (nullptr );
82928292 _c4assert (first);
8293- _c4dbgpf (" first annotation: {} indent={} line={}" , first->str , first->indentation , first->line );
8293+ _c4dbgpf (" first annotation: {} indent={} line={}" , _maybe_null_str ( first->str ) , first->indentation , first->line );
82948294 if (total > 1 )
82958295 {
82968296 _c4assert (total == 2 );
82978297 // assign to second
82988298 second = get_first_on_same_line (first);
82998299 _c4assert (second);
8300- _c4dbgpf (" second annotation: {} indent={} line={}" , second->str , second->indentation , second->line );
8300+ _c4dbgpf (" second annotation: {} indent={} line={}" , _maybe_null_str ( second->str ) , second->indentation , second->line );
83018301 }
83028302 auto extract_string = [&](EntryPtr e){
83038303 // tags can be null when the arena ran out of space
@@ -8307,7 +8307,7 @@ uint32_t ParseEngine<EventHandler>::_get_annotations_same_line(csubstr token_sou
83078307 _c4assert (tag.str );
83088308 _c4assert (tag.len );
83098309 _c4assert (tag.is_sub (token_soup));
8310- _c4dbgpf (" tag: {} -> {}" , e->str . str ? e-> str : csubstr ( " (out of size) " ), tag);
8310+ _c4dbgpf (" tag: {} -> {}" , _maybe_null_str ( e->str ), tag);
83118311 return tag;
83128312 }
83138313 csubstr anchor = e->str ;
0 commit comments