MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / jl_parse_value

Function jl_parse_value

src/cli/config_json_like.c:578–613  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

576}
577
578static int jl_parse_value(jl_parser_t *parser, unsigned depth, size_t *start_out, size_t *end_out) {
579 if (depth > JL_MAX_DEPTH || parser->pos >= parser->length) {
580 return -1;
581 }
582 size_t start = parser->pos;
583 unsigned char c = (unsigned char)parser->text[parser->pos];
584 int result = -1;
585 if (c == '{') {
586 result = jl_parse_object(parser, depth);
587 } else if (c == '[') {
588 result = jl_parse_array(parser, depth);
589 } else if (c == '"' || (!parser->strict && c == '\'')) {
590 result = jl_parse_string(parser, NULL, NULL);
591 } else if (jl_has_prefix(parser, "true")) {
592 parser->pos += 4U;
593 result = 0;
594 } else if (jl_has_prefix(parser, "false")) {
595 parser->pos += 5U;
596 result = 0;
597 } else if (jl_has_prefix(parser, "null")) {
598 parser->pos += 4U;
599 result = 0;
600 } else {
601 result = jl_parse_number(parser);
602 }
603 if (result != 0) {
604 return -1;
605 }
606 if (start_out) {
607 *start_out = start;
608 }
609 if (end_out) {
610 *end_out = parser->pos;
611 }
612 return 0;
613}
614
615static int jl_validate_document(const char *text, size_t length, size_t *root_out) {
616 if (jl_validate_utf8(text, length) != 0) {

Callers 7

jl_parse_objectFunction · 0.85
jl_parse_arrayFunction · 0.85
jl_validate_documentFunction · 0.85
jl_validate_entryFunction · 0.85
jl_scan_objectFunction · 0.85
jl_scan_arrayFunction · 0.85
jl_decode_field_stringFunction · 0.85

Calls 5

jl_parse_objectFunction · 0.85
jl_parse_arrayFunction · 0.85
jl_parse_stringFunction · 0.85
jl_has_prefixFunction · 0.85
jl_parse_numberFunction · 0.85

Tested by

no test coverage detected