Rename TYPE_REAL to TYPE_FLOAT
To be consistent with the naming everywhere else.
This commit is contained in:
parent
ea7dd1be36
commit
02f60812ed
|
@ -557,7 +557,7 @@ void register_global_constants() {
|
||||||
BIND_CORE_ENUM_CONSTANT_CUSTOM("TYPE_NIL", Variant::NIL);
|
BIND_CORE_ENUM_CONSTANT_CUSTOM("TYPE_NIL", Variant::NIL);
|
||||||
BIND_CORE_ENUM_CONSTANT_CUSTOM("TYPE_BOOL", Variant::BOOL);
|
BIND_CORE_ENUM_CONSTANT_CUSTOM("TYPE_BOOL", Variant::BOOL);
|
||||||
BIND_CORE_ENUM_CONSTANT_CUSTOM("TYPE_INT", Variant::INT);
|
BIND_CORE_ENUM_CONSTANT_CUSTOM("TYPE_INT", Variant::INT);
|
||||||
BIND_CORE_ENUM_CONSTANT_CUSTOM("TYPE_REAL", Variant::FLOAT);
|
BIND_CORE_ENUM_CONSTANT_CUSTOM("TYPE_FLOAT", Variant::FLOAT);
|
||||||
BIND_CORE_ENUM_CONSTANT_CUSTOM("TYPE_STRING", Variant::STRING);
|
BIND_CORE_ENUM_CONSTANT_CUSTOM("TYPE_STRING", Variant::STRING);
|
||||||
BIND_CORE_ENUM_CONSTANT_CUSTOM("TYPE_VECTOR2", Variant::VECTOR2);
|
BIND_CORE_ENUM_CONSTANT_CUSTOM("TYPE_VECTOR2", Variant::VECTOR2);
|
||||||
BIND_CORE_ENUM_CONSTANT_CUSTOM("TYPE_VECTOR2I", Variant::VECTOR2I);
|
BIND_CORE_ENUM_CONSTANT_CUSTOM("TYPE_VECTOR2I", Variant::VECTOR2I);
|
||||||
|
|
|
@ -2504,7 +2504,7 @@
|
||||||
<constant name="TYPE_INT" value="2" enum="Variant.Type">
|
<constant name="TYPE_INT" value="2" enum="Variant.Type">
|
||||||
Variable is of type [int].
|
Variable is of type [int].
|
||||||
</constant>
|
</constant>
|
||||||
<constant name="TYPE_REAL" value="3" enum="Variant.Type">
|
<constant name="TYPE_FLOAT" value="3" enum="Variant.Type">
|
||||||
Variable is of type [float] (real).
|
Variable is of type [float] (real).
|
||||||
</constant>
|
</constant>
|
||||||
<constant name="TYPE_STRING" value="4" enum="Variant.Type">
|
<constant name="TYPE_STRING" value="4" enum="Variant.Type">
|
||||||
|
|
|
@ -52,7 +52,7 @@ typedef enum godot_variant_type {
|
||||||
// atomic types
|
// atomic types
|
||||||
GODOT_VARIANT_TYPE_BOOL,
|
GODOT_VARIANT_TYPE_BOOL,
|
||||||
GODOT_VARIANT_TYPE_INT,
|
GODOT_VARIANT_TYPE_INT,
|
||||||
GODOT_VARIANT_TYPE_REAL,
|
GODOT_VARIANT_TYPE_FLOAT,
|
||||||
GODOT_VARIANT_TYPE_STRING,
|
GODOT_VARIANT_TYPE_STRING,
|
||||||
|
|
||||||
// math types
|
// math types
|
||||||
|
|
|
@ -223,7 +223,7 @@ const char *ShaderLanguage::token_names[TK_MAX] = {
|
||||||
|
|
||||||
String ShaderLanguage::get_token_text(Token p_token) {
|
String ShaderLanguage::get_token_text(Token p_token) {
|
||||||
String name = token_names[p_token.type];
|
String name = token_names[p_token.type];
|
||||||
if (p_token.type == TK_INT_CONSTANT || p_token.type == TK_REAL_CONSTANT) {
|
if (p_token.type == TK_INT_CONSTANT || p_token.type == TK_FLOAT_CONSTANT) {
|
||||||
name += "(" + rtos(p_token.constant) + ")";
|
name += "(" + rtos(p_token.constant) + ")";
|
||||||
} else if (p_token.type == TK_IDENTIFIER) {
|
} else if (p_token.type == TK_IDENTIFIER) {
|
||||||
name += "(" + String(p_token.text) + ")";
|
name += "(" + String(p_token.text) + ")";
|
||||||
|
@ -637,7 +637,7 @@ ShaderLanguage::Token ShaderLanguage::_get_token() {
|
||||||
char_idx += str.length();
|
char_idx += str.length();
|
||||||
Token tk;
|
Token tk;
|
||||||
if (period_found || exponent_found || float_suffix_found) {
|
if (period_found || exponent_found || float_suffix_found) {
|
||||||
tk.type = TK_REAL_CONSTANT;
|
tk.type = TK_FLOAT_CONSTANT;
|
||||||
} else {
|
} else {
|
||||||
tk.type = TK_INT_CONSTANT;
|
tk.type = TK_INT_CONSTANT;
|
||||||
}
|
}
|
||||||
|
@ -3269,7 +3269,7 @@ ShaderLanguage::Node *ShaderLanguage::_parse_expression(BlockNode *p_block, cons
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if (tk.type == TK_REAL_CONSTANT) {
|
} else if (tk.type == TK_FLOAT_CONSTANT) {
|
||||||
ConstantNode *constant = alloc_node<ConstantNode>();
|
ConstantNode *constant = alloc_node<ConstantNode>();
|
||||||
ConstantNode::Value v;
|
ConstantNode::Value v;
|
||||||
v.real = tk.constant;
|
v.real = tk.constant;
|
||||||
|
@ -6260,7 +6260,7 @@ Error ShaderLanguage::_parse_shader(const Map<StringName, FunctionInfo> &p_funct
|
||||||
tk = _get_token();
|
tk = _get_token();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tk.type != TK_REAL_CONSTANT && tk.type != TK_INT_CONSTANT) {
|
if (tk.type != TK_FLOAT_CONSTANT && tk.type != TK_INT_CONSTANT) {
|
||||||
_set_error("Expected integer constant");
|
_set_error("Expected integer constant");
|
||||||
return ERR_PARSE_ERROR;
|
return ERR_PARSE_ERROR;
|
||||||
}
|
}
|
||||||
|
@ -6284,7 +6284,7 @@ Error ShaderLanguage::_parse_shader(const Map<StringName, FunctionInfo> &p_funct
|
||||||
tk = _get_token();
|
tk = _get_token();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tk.type != TK_REAL_CONSTANT && tk.type != TK_INT_CONSTANT) {
|
if (tk.type != TK_FLOAT_CONSTANT && tk.type != TK_INT_CONSTANT) {
|
||||||
_set_error("Expected integer constant after ','");
|
_set_error("Expected integer constant after ','");
|
||||||
return ERR_PARSE_ERROR;
|
return ERR_PARSE_ERROR;
|
||||||
}
|
}
|
||||||
|
@ -6297,7 +6297,7 @@ Error ShaderLanguage::_parse_shader(const Map<StringName, FunctionInfo> &p_funct
|
||||||
if (tk.type == TK_COMMA) {
|
if (tk.type == TK_COMMA) {
|
||||||
tk = _get_token();
|
tk = _get_token();
|
||||||
|
|
||||||
if (tk.type != TK_REAL_CONSTANT && tk.type != TK_INT_CONSTANT) {
|
if (tk.type != TK_FLOAT_CONSTANT && tk.type != TK_INT_CONSTANT) {
|
||||||
_set_error("Expected integer constant after ','");
|
_set_error("Expected integer constant after ','");
|
||||||
return ERR_PARSE_ERROR;
|
return ERR_PARSE_ERROR;
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,7 +46,7 @@ public:
|
||||||
TK_IDENTIFIER,
|
TK_IDENTIFIER,
|
||||||
TK_TRUE,
|
TK_TRUE,
|
||||||
TK_FALSE,
|
TK_FALSE,
|
||||||
TK_REAL_CONSTANT,
|
TK_FLOAT_CONSTANT,
|
||||||
TK_INT_CONSTANT,
|
TK_INT_CONSTANT,
|
||||||
TK_TYPE_VOID,
|
TK_TYPE_VOID,
|
||||||
TK_TYPE_BOOL,
|
TK_TYPE_BOOL,
|
||||||
|
|
Loading…
Reference in New Issue