Utility to jump whitespace and cr/lf */
| 1083 | |
| 1084 | /* Utility to jump whitespace and cr/lf */ |
| 1085 | static parse_buffer *buffer_skip_whitespace(parse_buffer * const buffer) |
| 1086 | { |
| 1087 | if ((buffer == NULL) || (buffer->content == NULL)) |
| 1088 | { |
| 1089 | return NULL; |
| 1090 | } |
| 1091 | |
| 1092 | if (cannot_access_at_index(buffer, 0)) |
| 1093 | { |
| 1094 | return buffer; |
| 1095 | } |
| 1096 | |
| 1097 | while (can_access_at_index(buffer, 0) && (buffer_at_offset(buffer)[0] <= 32)) |
| 1098 | { |
| 1099 | buffer->offset++; |
| 1100 | } |
| 1101 | |
| 1102 | if (buffer->offset == buffer->length) |
| 1103 | { |
| 1104 | buffer->offset--; |
| 1105 | } |
| 1106 | |
| 1107 | return buffer; |
| 1108 | } |
| 1109 | |
| 1110 | /* skip the UTF-8 BOM (byte order mark) if it is at the beginning of a buffer */ |
| 1111 | static parse_buffer *skip_utf8_bom(parse_buffer * const buffer) |
no outgoing calls
no test coverage detected
searching dependent graphs…