From 0cb185927c1021f07c8c2111fc73b7f712ea393f Mon Sep 17 00:00:00 2001 From: George Marques Date: Thu, 26 Nov 2020 14:41:55 -0300 Subject: GDScript: Improve handling of operators - Use the new functions in Variant to determine the validity and resulting type of operators. - Split the operator function in codegen between binary and unary, since the unary ones have now a special requirement of having the second argument to be the NIL type when requesting info. --- modules/gdscript/gdscript_byte_codegen.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'modules/gdscript/gdscript_byte_codegen.h') diff --git a/modules/gdscript/gdscript_byte_codegen.h b/modules/gdscript/gdscript_byte_codegen.h index 0173b7f820..34d2bb6098 100644 --- a/modules/gdscript/gdscript_byte_codegen.h +++ b/modules/gdscript/gdscript_byte_codegen.h @@ -377,7 +377,8 @@ public: #endif virtual void set_initial_line(int p_line) override; - virtual void write_operator(const Address &p_target, Variant::Operator p_operator, const Address &p_left_operand, const Address &p_right_operand) override; + virtual void write_unary_operator(const Address &p_target, Variant::Operator p_operator, const Address &p_left_operand) override; + virtual void write_binary_operator(const Address &p_target, Variant::Operator p_operator, const Address &p_left_operand, const Address &p_right_operand) override; virtual void write_type_test(const Address &p_target, const Address &p_source, const Address &p_type) override; virtual void write_type_test_builtin(const Address &p_target, const Address &p_source, Variant::Type p_type) override; virtual void write_and_left_operand(const Address &p_left_operand) override; -- cgit v1.2.3