| 208 | } |
| 209 | |
| 210 | static 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 | |
| 252 | static int jl_parse_string(jl_parser_t *parser, size_t *start_out, size_t *end_out) { |
| 253 | if (parser->pos >= parser->length) { |
no test coverage detected