Fix ^= operator in shaders

This commit is contained in:
Yuri Roubinsky 2021-12-03 10:20:44 +03:00
parent 1f666a972f
commit 10b10ae1fa

View File

@ -88,7 +88,8 @@ String ShaderLanguage::get_operator_text(Operator p_op) {
"--", "--",
"()", "()",
"construct", "construct",
"index" }; "index",
"empty" };
return op_names[p_op]; return op_names[p_op];
} }
@ -474,6 +475,10 @@ ShaderLanguage::Token ShaderLanguage::_get_token() {
case ':': case ':':
return _make_token(TK_COLON); return _make_token(TK_COLON);
case '^': case '^':
if (GETCHAR(0) == '=') {
char_idx++;
return _make_token(TK_OP_ASSIGN_BIT_XOR);
}
return _make_token(TK_OP_BIT_XOR); return _make_token(TK_OP_BIT_XOR);
case '~': case '~':
return _make_token(TK_OP_BIT_INVERT); return _make_token(TK_OP_BIT_INVERT);