summaryrefslogtreecommitdiff
path: root/modules/gdscript/gdscript_codegen.h
diff options
context:
space:
mode:
authorGeorge Marques <george@gmarqu.es>2020-11-26 14:41:55 -0300
committerGeorge Marques <george@gmarqu.es>2020-11-26 14:41:55 -0300
commit0cb185927c1021f07c8c2111fc73b7f712ea393f (patch)
tree6753bda3f1ba16fd781a125899bc74521a700b00 /modules/gdscript/gdscript_codegen.h
parent613b76cfd5b57d6fb13f856ad149f2b47ca5dcb3 (diff)
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.
Diffstat (limited to 'modules/gdscript/gdscript_codegen.h')
-rw-r--r--modules/gdscript/gdscript_codegen.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/modules/gdscript/gdscript_codegen.h b/modules/gdscript/gdscript_codegen.h
index decab3df0b..35e326c61f 100644
--- a/modules/gdscript/gdscript_codegen.h
+++ b/modules/gdscript/gdscript_codegen.h
@@ -98,7 +98,8 @@ public:
// virtual void alloc_stack(int p_level) = 0; // Is this needed?
// virtual void alloc_call(int p_arg_count) = 0; // This might be automatic from other functions.
- virtual void write_operator(const Address &p_target, Variant::Operator p_operator, const Address &p_left_operand, const Address &p_right_operand) = 0;
+ virtual void write_unary_operator(const Address &p_target, Variant::Operator p_operator, const Address &p_left_operand) = 0;
+ virtual void write_binary_operator(const Address &p_target, Variant::Operator p_operator, const Address &p_left_operand, const Address &p_right_operand) = 0;
virtual void write_type_test(const Address &p_target, const Address &p_source, const Address &p_type) = 0;
virtual void write_type_test_builtin(const Address &p_target, const Address &p_source, Variant::Type p_type) = 0;
virtual void write_and_left_operand(const Address &p_left_operand) = 0;