summaryrefslogtreecommitdiff
path: root/core/io/json.cpp
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2020-05-10 13:00:47 +0200
committerRémi Verschelde <rverschelde@gmail.com>2020-05-10 13:13:54 +0200
commit69de7ce38c40c57a1fabe12c9e5a3eab903a4035 (patch)
tree5fe1318bd315e40b0693307a28cd65107cb135ae /core/io/json.cpp
parente956e80c1fa1cc8aefcb1533e5acf5cf3c8ffdd9 (diff)
Style: clang-format: Disable AllowShortCaseLabelsOnASingleLine
Part of #33027.
Diffstat (limited to 'core/io/json.cpp')
-rw-r--r--core/io/json.cpp35
1 files changed, 25 insertions, 10 deletions
diff --git a/core/io/json.cpp b/core/io/json.cpp
index 3a0edceb81..0186547dd2 100644
--- a/core/io/json.cpp
+++ b/core/io/json.cpp
@@ -67,10 +67,14 @@ String JSON::_print_var(const Variant &p_var, const String &p_indent, int p_cur_
switch (p_var.get_type()) {
- case Variant::NIL: return "null";
- case Variant::BOOL: return p_var.operator bool() ? "true" : "false";
- case Variant::INT: return itos(p_var);
- case Variant::FLOAT: return rtos(p_var);
+ case Variant::NIL:
+ return "null";
+ case Variant::BOOL:
+ return p_var.operator bool() ? "true" : "false";
+ case Variant::INT:
+ return itos(p_var);
+ case Variant::FLOAT:
+ return rtos(p_var);
case Variant::PACKED_INT32_ARRAY:
case Variant::PACKED_INT64_ARRAY:
case Variant::PACKED_FLOAT32_ARRAY:
@@ -116,7 +120,8 @@ String JSON::_print_var(const Variant &p_var, const String &p_indent, int p_cur_
s += end_statement + _make_indent(p_indent, p_cur_indent) + "}";
return s;
};
- default: return "\"" + String(p_var).json_escape() + "\"";
+ default:
+ return "\"" + String(p_var).json_escape() + "\"";
}
}
@@ -199,11 +204,21 @@ Error JSON::_get_token(const CharType *p_str, int &index, int p_len, Token &r_to
switch (next) {
- case 'b': res = 8; break;
- case 't': res = 9; break;
- case 'n': res = 10; break;
- case 'f': res = 12; break;
- case 'r': res = 13; break;
+ case 'b':
+ res = 8;
+ break;
+ case 't':
+ res = 9;
+ break;
+ case 'n':
+ res = 10;
+ break;
+ case 'f':
+ res = 12;
+ break;
+ case 'r':
+ res = 13;
+ break;
case 'u': {
// hex number
for (int j = 0; j < 4; j++) {