You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +00:00
Synchronize parameter names in definition and declaration
Fixes #10244.
This commit is contained in:
committed by
Rémi Verschelde
parent
b1ecaaa22b
commit
00f6c85928
@@ -94,15 +94,15 @@ String JSON::print(const Variant &p_var) {
|
||||
return _print_var(p_var);
|
||||
}
|
||||
|
||||
Error JSON::_get_token(const CharType *p_str, int &idx, int p_len, Token &r_token, int &line, String &r_err_str) {
|
||||
Error JSON::_get_token(const CharType *p_str, int &index, int p_len, Token &r_token, int &line, String &r_err_str) {
|
||||
|
||||
while (p_len > 0) {
|
||||
switch (p_str[idx]) {
|
||||
switch (p_str[index]) {
|
||||
|
||||
case '\n': {
|
||||
|
||||
line++;
|
||||
idx++;
|
||||
index++;
|
||||
break;
|
||||
};
|
||||
case 0: {
|
||||
@@ -112,54 +112,54 @@ Error JSON::_get_token(const CharType *p_str, int &idx, int p_len, Token &r_toke
|
||||
case '{': {
|
||||
|
||||
r_token.type = TK_CURLY_BRACKET_OPEN;
|
||||
idx++;
|
||||
index++;
|
||||
return OK;
|
||||
};
|
||||
case '}': {
|
||||
|
||||
r_token.type = TK_CURLY_BRACKET_CLOSE;
|
||||
idx++;
|
||||
index++;
|
||||
return OK;
|
||||
};
|
||||
case '[': {
|
||||
|
||||
r_token.type = TK_BRACKET_OPEN;
|
||||
idx++;
|
||||
index++;
|
||||
return OK;
|
||||
};
|
||||
case ']': {
|
||||
|
||||
r_token.type = TK_BRACKET_CLOSE;
|
||||
idx++;
|
||||
index++;
|
||||
return OK;
|
||||
};
|
||||
case ':': {
|
||||
|
||||
r_token.type = TK_COLON;
|
||||
idx++;
|
||||
index++;
|
||||
return OK;
|
||||
};
|
||||
case ',': {
|
||||
|
||||
r_token.type = TK_COMMA;
|
||||
idx++;
|
||||
index++;
|
||||
return OK;
|
||||
};
|
||||
case '"': {
|
||||
|
||||
idx++;
|
||||
index++;
|
||||
String str;
|
||||
while (true) {
|
||||
if (p_str[idx] == 0) {
|
||||
if (p_str[index] == 0) {
|
||||
r_err_str = "Unterminated String";
|
||||
return ERR_PARSE_ERROR;
|
||||
} else if (p_str[idx] == '"') {
|
||||
idx++;
|
||||
} else if (p_str[index] == '"') {
|
||||
index++;
|
||||
break;
|
||||
} else if (p_str[idx] == '\\') {
|
||||
} else if (p_str[index] == '\\') {
|
||||
//escaped characters...
|
||||
idx++;
|
||||
CharType next = p_str[idx];
|
||||
index++;
|
||||
CharType next = p_str[index];
|
||||
if (next == 0) {
|
||||
r_err_str = "Unterminated String";
|
||||
return ERR_PARSE_ERROR;
|
||||
@@ -177,7 +177,7 @@ Error JSON::_get_token(const CharType *p_str, int &idx, int p_len, Token &r_toke
|
||||
//hexnumbarh - oct is deprecated
|
||||
|
||||
for (int j = 0; j < 4; j++) {
|
||||
CharType c = p_str[idx + j + 1];
|
||||
CharType c = p_str[index + j + 1];
|
||||
if (c == 0) {
|
||||
r_err_str = "Unterminated String";
|
||||
return ERR_PARSE_ERROR;
|
||||
@@ -204,7 +204,7 @@ Error JSON::_get_token(const CharType *p_str, int &idx, int p_len, Token &r_toke
|
||||
res <<= 4;
|
||||
res |= v;
|
||||
}
|
||||
idx += 4; //will add at the end anyway
|
||||
index += 4; //will add at the end anyway
|
||||
|
||||
} break;
|
||||
//case '\"': res='\"'; break;
|
||||
@@ -220,11 +220,11 @@ Error JSON::_get_token(const CharType *p_str, int &idx, int p_len, Token &r_toke
|
||||
str += res;
|
||||
|
||||
} else {
|
||||
if (p_str[idx] == '\n')
|
||||
if (p_str[index] == '\n')
|
||||
line++;
|
||||
str += p_str[idx];
|
||||
str += p_str[index];
|
||||
}
|
||||
idx++;
|
||||
index++;
|
||||
}
|
||||
|
||||
r_token.type = TK_STRING;
|
||||
@@ -234,28 +234,28 @@ Error JSON::_get_token(const CharType *p_str, int &idx, int p_len, Token &r_toke
|
||||
} break;
|
||||
default: {
|
||||
|
||||
if (p_str[idx] <= 32) {
|
||||
idx++;
|
||||
if (p_str[index] <= 32) {
|
||||
index++;
|
||||
break;
|
||||
}
|
||||
|
||||
if (p_str[idx] == '-' || (p_str[idx] >= '0' && p_str[idx] <= '9')) {
|
||||
if (p_str[index] == '-' || (p_str[index] >= '0' && p_str[index] <= '9')) {
|
||||
//a number
|
||||
const CharType *rptr;
|
||||
double number = String::to_double(&p_str[idx], &rptr);
|
||||
idx += (rptr - &p_str[idx]);
|
||||
double number = String::to_double(&p_str[index], &rptr);
|
||||
index += (rptr - &p_str[index]);
|
||||
r_token.type = TK_NUMBER;
|
||||
r_token.value = number;
|
||||
return OK;
|
||||
|
||||
} else if ((p_str[idx] >= 'A' && p_str[idx] <= 'Z') || (p_str[idx] >= 'a' && p_str[idx] <= 'z')) {
|
||||
} else if ((p_str[index] >= 'A' && p_str[index] <= 'Z') || (p_str[index] >= 'a' && p_str[index] <= 'z')) {
|
||||
|
||||
String id;
|
||||
|
||||
while ((p_str[idx] >= 'A' && p_str[idx] <= 'Z') || (p_str[idx] >= 'a' && p_str[idx] <= 'z')) {
|
||||
while ((p_str[index] >= 'A' && p_str[index] <= 'Z') || (p_str[index] >= 'a' && p_str[index] <= 'z')) {
|
||||
|
||||
id += p_str[idx];
|
||||
idx++;
|
||||
id += p_str[index];
|
||||
index++;
|
||||
}
|
||||
|
||||
r_token.type = TK_IDENTIFIER;
|
||||
|
||||
Reference in New Issue
Block a user