@@ -45,7 +45,7 @@ bool ParsedJson::allocate_capacity(size_t len, size_t max_depth) {
4545 if (!string_buf || !tape ||
4646 !containing_scope_offset || !ret_address ||
4747 !structural_indexes) {
48- std::cerr << " Could not allocate memory" << std::endl;
48+ // Could not allocate memory
4949 return false ;
5050 }
5151 /*
@@ -102,13 +102,11 @@ bool ParsedJson::print_json(std::ostream &os) const {
102102 if (type == ' r' ) {
103103 how_many = tape_val & JSON_VALUE_MASK;
104104 } else {
105- fprintf (stderr, " Error: no starting root node?" );
105+ // Error: no starting root node?
106106 return false ;
107107 }
108108 if (how_many > tape_capacity) {
109- fprintf (
110- stderr,
111- " We may be exceeding the tape capacity. Is this a valid document?\n " );
109+ // We may be exceeding the tape capacity. Is this a valid document?
112110 return false ;
113111 }
114112 tape_idx++;
@@ -195,10 +193,10 @@ bool ParsedJson::print_json(std::ostream &os) const {
195193 os << ' ]' ;
196194 break ;
197195 case ' r' : // we start and end with the root node
198- fprintf (stderr, " should we be hitting the root node?\n " );
196+ // should we be hitting the root node?
199197 return false ;
200198 default :
201- fprintf (stderr, " bug %c \n " , type);
199+ // bug?
202200 return false ;
203201 }
204202 }
@@ -220,7 +218,7 @@ bool ParsedJson::dump_raw_tape(std::ostream &os) const {
220218 if (type == ' r' ) {
221219 how_many = tape_val & JSON_VALUE_MASK;
222220 } else {
223- fprintf (stderr, " Error: no starting root node?" );
221+ // Error: no starting root node?
224222 return false ;
225223 }
226224 os << " \t // pointing to " << how_many << " (right after last node)\n " ;
@@ -288,7 +286,7 @@ bool ParsedJson::dump_raw_tape(std::ostream &os) const {
288286 << " (start of the scope) \n " ;
289287 break ;
290288 case ' r' : // we start and end with the root node
291- fprintf (stderr, " should we be hitting the root node?\n " );
289+ // should we be hitting the root node?
292290 return false ;
293291 default :
294292 return false ;
0 commit comments