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

Function jl_skip_trivia

src/cli/config_json_like.c:210–250  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

208}
209
210static int jl_skip_trivia(jl_parser_t *parser) {
211 while (parser->pos < parser->length) {
212 unsigned char c = (unsigned char)parser->text[parser->pos];
213 size_t whitespace_width = jl_whitespace_width(parser);
214 if (whitespace_width > 0U) {
215 parser->pos += whitespace_width;
216 continue;
217 }
218 if (parser->strict || c != '/' || parser->pos + 1U >= parser->length) {
219 return 0;
220 }
221
222 unsigned char next = (unsigned char)parser->text[parser->pos + 1U];
223 if (next == '/') {
224 parser->pos += 2U;
225 while (parser->pos < parser->length &&
226 jl_line_terminator_width(parser->text, parser->length, parser->pos) == 0U) {
227 parser->pos++;
228 }
229 continue;
230 }
231 if (next == '*') {
232 parser->pos += 2U;
233 bool closed = false;
234 while (parser->pos + 1U < parser->length) {
235 if (parser->text[parser->pos] == '*' && parser->text[parser->pos + 1U] == '/') {
236 parser->pos += 2U;
237 closed = true;
238 break;
239 }
240 parser->pos++;
241 }
242 if (!closed) {
243 return -1;
244 }
245 continue;
246 }
247 return 0;
248 }
249 return 0;
250}
251
252static int jl_parse_string(jl_parser_t *parser, size_t *start_out, size_t *end_out) {
253 if (parser->pos >= parser->length) {

Callers 8

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
jl_field_shape_matchesFunction · 0.85

Calls 2

jl_whitespace_widthFunction · 0.85
jl_line_terminator_widthFunction · 0.85

Tested by

no test coverage detected