| 109 CxJsonTokenType ttype; |
109 CxJsonTokenType ttype; |
| 110 if (isstring) { |
110 if (isstring) { |
| 111 ttype = CX_JSON_TOKEN_STRING; |
111 ttype = CX_JSON_TOKEN_STRING; |
| 112 } else { |
112 } else { |
| 113 cxstring s = cx_strcast(str); |
113 cxstring s = cx_strcast(str); |
| 114 if (!cx_strcmp(s, CX_STR("true")) || !cx_strcmp(s, CX_STR("false")) |
114 if (!cx_strcmp(s, "true") || !cx_strcmp(s, "false") |
| 115 || !cx_strcmp(s, CX_STR("null"))) { |
115 || !cx_strcmp(s, "null")) { |
| 116 ttype = CX_JSON_TOKEN_LITERAL; |
116 ttype = CX_JSON_TOKEN_LITERAL; |
| 117 } else { |
117 } else { |
| 118 ttype = token_numbertype(str.ptr, str.length); |
118 ttype = token_numbertype(str.ptr, str.length); |
| 119 } |
119 } |
| 120 } |
120 } |
| 676 } |
676 } |
| 677 case CX_JSON_TOKEN_LITERAL: { |
677 case CX_JSON_TOKEN_LITERAL: { |
| 678 if ((vbuf = json_create_value(json, CX_JSON_LITERAL)) == NULL) { |
678 if ((vbuf = json_create_value(json, CX_JSON_LITERAL)) == NULL) { |
| 679 return_rec(CX_JSON_VALUE_ALLOC_FAILED); // LCOV_EXCL_LINE |
679 return_rec(CX_JSON_VALUE_ALLOC_FAILED); // LCOV_EXCL_LINE |
| 680 } |
680 } |
| 681 if (0 == cx_strcmp(cx_strcast(token.content), cx_str("true"))) { |
681 if (0 == cx_strcmp(token.content, "true")) { |
| 682 vbuf->literal = CX_JSON_TRUE; |
682 vbuf->literal = CX_JSON_TRUE; |
| 683 } else if (0 == cx_strcmp(cx_strcast(token.content), cx_str("false"))) { |
683 } else if (0 == cx_strcmp(token.content, "false")) { |
| 684 vbuf->literal = CX_JSON_FALSE; |
684 vbuf->literal = CX_JSON_FALSE; |
| 685 } else { |
685 } else { |
| 686 vbuf->literal = CX_JSON_NULL; |
686 vbuf->literal = CX_JSON_NULL; |
| 687 } |
687 } |
| 688 return_rec(CX_JSON_NO_ERROR); |
688 return_rec(CX_JSON_NO_ERROR); |