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

Function jl_parse_value

src/cli/config_json_like.c:579–614  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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