summaryrefslogtreecommitdiff
path: root/core/io/json.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/io/json.cpp')
-rw-r--r--core/io/json.cpp20
1 files changed, 8 insertions, 12 deletions
diff --git a/core/io/json.cpp b/core/io/json.cpp
index dbf1676e62..3a0edceb81 100644
--- a/core/io/json.cpp
+++ b/core/io/json.cpp
@@ -70,10 +70,12 @@ String JSON::_print_var(const Variant &p_var, const String &p_indent, int p_cur_
case Variant::NIL: return "null";
case Variant::BOOL: return p_var.operator bool() ? "true" : "false";
case Variant::INT: return itos(p_var);
- case Variant::REAL: return rtos(p_var);
- case Variant::POOL_INT_ARRAY:
- case Variant::POOL_REAL_ARRAY:
- case Variant::POOL_STRING_ARRAY:
+ case Variant::FLOAT: return rtos(p_var);
+ case Variant::PACKED_INT32_ARRAY:
+ case Variant::PACKED_INT64_ARRAY:
+ case Variant::PACKED_FLOAT32_ARRAY:
+ case Variant::PACKED_FLOAT64_ARRAY:
+ case Variant::PACKED_STRING_ARRAY:
case Variant::ARRAY: {
String s = "[";
@@ -203,8 +205,7 @@ Error JSON::_get_token(const CharType *p_str, int &index, int p_len, Token &r_to
case 'f': res = 12; break;
case 'r': res = 13; break;
case 'u': {
- //hexnumbarh - oct is deprecated
-
+ // hex number
for (int j = 0; j < 4; j++) {
CharType c = p_str[index + j + 1];
if (c == 0) {
@@ -226,7 +227,7 @@ Error JSON::_get_token(const CharType *p_str, int &index, int p_len, Token &r_to
v = c - 'A';
v += 10;
} else {
- ERR_PRINT("BUG");
+ ERR_PRINT("Bug parsing hex constant.");
v = 0;
}
@@ -236,13 +237,8 @@ Error JSON::_get_token(const CharType *p_str, int &index, int p_len, Token &r_to
index += 4; //will add at the end anyway
} break;
- //case '\"': res='\"'; break;
- //case '\\': res='\\'; break;
- //case '/': res='/'; break;
default: {
res = next;
- //r_err_str="Invalid escape sequence";
- //return ERR_PARSE_ERROR;
} break;
}