src/json.c

changeset 1668
3ffdfe1776b4
parent 1667
608cc0b25352
equal deleted inserted replaced
1667:608cc0b25352 1668:3ffdfe1776b4
173 // current token type and start index 173 // current token type and start index
174 CxJsonTokenType ttype = json->uncompleted_tokentype; 174 CxJsonTokenType ttype = json->uncompleted_tokentype;
175 size_t token_part_start = json->buffer.pos; 175 size_t token_part_start = json->buffer.pos;
176 176
177 bool escape_end_of_string = ttype == CX_JSON_TOKEN_STRING 177 bool escape_end_of_string = ttype == CX_JSON_TOKEN_STRING
178 && json->uncompleted_content.ptr[json->uncompleted_content.length-1] == '\\'; 178 && cx_strat(json->uncompleted_content, -1) == '\\';
179 179
180 for (size_t i = json->buffer.pos; i < json->buffer.size; i++) { 180 for (size_t i = json->buffer.pos; i < json->buffer.size; i++) {
181 char c = json->buffer.space[i]; 181 char c = json->buffer.space[i];
182 if (ttype != CX_JSON_TOKEN_STRING) { 182 if (ttype != CX_JSON_TOKEN_STRING) {
183 // currently non-string token 183 // currently non-string token

mercurial