summaryrefslogtreecommitdiff
path: root/modules/gdscript/gdscript_parser.h
diff options
context:
space:
mode:
Diffstat (limited to 'modules/gdscript/gdscript_parser.h')
-rw-r--r--modules/gdscript/gdscript_parser.h17
1 files changed, 15 insertions, 2 deletions
diff --git a/modules/gdscript/gdscript_parser.h b/modules/gdscript/gdscript_parser.h
index 80d4b7c25f..346c9bc45d 100644
--- a/modules/gdscript/gdscript_parser.h
+++ b/modules/gdscript/gdscript_parser.h
@@ -91,6 +91,7 @@ public:
struct SuiteNode;
struct TernaryOpNode;
struct TypeNode;
+ struct TypeTestNode;
struct UnaryOpNode;
struct VariableNode;
struct WhileNode;
@@ -290,6 +291,7 @@ public:
SUITE,
TERNARY_OPERATOR,
TYPE,
+ TYPE_TEST,
UNARY_OPERATOR,
VARIABLE,
WHILE,
@@ -428,7 +430,6 @@ public:
OP_BIT_XOR,
OP_LOGIC_AND,
OP_LOGIC_OR,
- OP_TYPE_TEST,
OP_CONTENT_TEST,
OP_COMP_EQUAL,
OP_COMP_NOT_EQUAL,
@@ -1152,6 +1153,16 @@ public:
}
};
+ struct TypeTestNode : public ExpressionNode {
+ ExpressionNode *operand = nullptr;
+ TypeNode *test_type = nullptr;
+ DataType test_datatype;
+
+ TypeTestNode() {
+ type = TYPE_TEST;
+ }
+ };
+
struct UnaryOpNode : public ExpressionNode {
enum OpType {
OP_POSITIVE,
@@ -1462,6 +1473,7 @@ private:
ExpressionNode *parse_attribute(ExpressionNode *p_previous_operand, bool p_can_assign);
ExpressionNode *parse_subscript(ExpressionNode *p_previous_operand, bool p_can_assign);
ExpressionNode *parse_lambda(ExpressionNode *p_previous_operand, bool p_can_assign);
+ ExpressionNode *parse_type_test(ExpressionNode *p_previous_operand, bool p_can_assign);
ExpressionNode *parse_yield(ExpressionNode *p_previous_operand, bool p_can_assign);
ExpressionNode *parse_invalid_token(ExpressionNode *p_previous_operand, bool p_can_assign);
TypeNode *parse_type(bool p_allow_void = false);
@@ -1543,8 +1555,9 @@ public:
void print_statement(Node *p_statement);
void print_subscript(SubscriptNode *p_subscript);
void print_suite(SuiteNode *p_suite);
- void print_type(TypeNode *p_type);
void print_ternary_op(TernaryOpNode *p_ternary_op);
+ void print_type(TypeNode *p_type);
+ void print_type_test(TypeTestNode *p_type_test);
void print_unary_op(UnaryOpNode *p_unary_op);
void print_variable(VariableNode *p_variable);
void print_while(WhileNode *p_while);