You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-15 13:51:40 +00:00
Fix parsing hexadecimal (lowercase e,f) in shaders
This commit is contained in:
@@ -558,13 +558,13 @@ ShaderLanguage::Token ShaderLanguage::_get_token() {
|
|||||||
return _make_token(TK_ERROR, "Invalid numeric constant");
|
return _make_token(TK_ERROR, "Invalid numeric constant");
|
||||||
}
|
}
|
||||||
hexa_found = true;
|
hexa_found = true;
|
||||||
} else if (GETCHAR(i) == 'e') {
|
} else if (GETCHAR(i) == 'e' && !hexa_found) {
|
||||||
if (hexa_found || exponent_found || float_suffix_found) {
|
if (exponent_found || float_suffix_found) {
|
||||||
return _make_token(TK_ERROR, "Invalid numeric constant");
|
return _make_token(TK_ERROR, "Invalid numeric constant");
|
||||||
}
|
}
|
||||||
exponent_found = true;
|
exponent_found = true;
|
||||||
} else if (GETCHAR(i) == 'f') {
|
} else if (GETCHAR(i) == 'f' && !hexa_found) {
|
||||||
if (hexa_found || exponent_found) {
|
if (exponent_found) {
|
||||||
return _make_token(TK_ERROR, "Invalid numeric constant");
|
return _make_token(TK_ERROR, "Invalid numeric constant");
|
||||||
}
|
}
|
||||||
float_suffix_found = true;
|
float_suffix_found = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user