aboutsummaryrefslogtreecommitdiff
path: root/modules/gdscript/gd_parser.h
diff options
context:
space:
mode:
Diffstat (limited to 'modules/gdscript/gd_parser.h')
-rw-r--r--modules/gdscript/gd_parser.h23
1 files changed, 18 insertions, 5 deletions
diff --git a/modules/gdscript/gd_parser.h b/modules/gdscript/gd_parser.h
index 6c49c1df5..e8f5f0f98 100644
--- a/modules/gdscript/gd_parser.h
+++ b/modules/gdscript/gd_parser.h
@@ -5,7 +5,7 @@
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -33,6 +33,7 @@
#include "gd_functions.h"
#include "map.h"
#include "object.h"
+#include "script_language.h"
class GDParser {
public:
@@ -88,6 +89,7 @@ public:
StringName getter;
int line;
Node *expression;
+ ScriptInstance::RPCMode rpc_mode;
};
struct Constant {
StringName identifier;
@@ -119,12 +121,13 @@ public:
struct FunctionNode : public Node {
bool _static;
+ ScriptInstance::RPCMode rpc_mode;
StringName name;
Vector<StringName> arguments;
Vector<Node*> default_values;
BlockNode *body;
- FunctionNode() { type=TYPE_FUNCTION; _static=false; }
+ FunctionNode() { type=TYPE_FUNCTION; _static=false; rpc_mode=ScriptInstance::RPC_MODE_DISABLED; }
};
@@ -206,6 +209,7 @@ public:
OP_INDEX_NAMED,
//unary operators
OP_NEG,
+ OP_POS,
OP_NOT,
OP_BIT_INVERT,
OP_PREINC,
@@ -244,6 +248,9 @@ public:
OP_BIT_AND,
OP_BIT_OR,
OP_BIT_XOR,
+ //ternary operators
+ OP_TERNARY_IF,
+ OP_TERNARY_ELSE,
};
Operator op;
@@ -369,13 +376,15 @@ public:
enum CompletionType {
COMPLETION_NONE,
COMPLETION_BUILT_IN_TYPE_CONSTANT,
+ COMPLETION_GET_NODE,
COMPLETION_FUNCTION,
COMPLETION_IDENTIFIER,
COMPLETION_PARENT_FUNCTION,
COMPLETION_METHOD,
COMPLETION_CALL_ARGUMENTS,
COMPLETION_INDEX,
- COMPLETION_VIRTUAL_FUNC
+ COMPLETION_VIRTUAL_FUNC,
+ COMPLETION_YIELD,
};
@@ -425,9 +434,13 @@ private:
int completion_line;
int completion_argument;
bool completion_found;
+ bool completion_ident_is_call;
PropertyInfo current_export;
+ ScriptInstance::RPCMode rpc_mode;
+
+
void _set_error(const String& p_error, int p_line=-1, int p_column=-1);
bool _recover_from_completion();
@@ -435,7 +448,7 @@ private:
bool _parse_arguments(Node* p_parent, Vector<Node*>& p_args, bool p_static, bool p_can_codecomplete=false);
bool _enter_indent_block(BlockNode *p_block=NULL);
bool _parse_newline();
- Node* _parse_expression(Node *p_parent,bool p_static,bool p_allow_assign=false);
+ Node* _parse_expression(Node *p_parent, bool p_static, bool p_allow_assign=false, bool p_parsing_constant=false);
Node* _reduce_expression(Node *p_node,bool p_to_const=false);
Node* _parse_and_reduce_expression(Node *p_parent,bool p_static,bool p_reduce_const=false,bool p_allow_assign=false);
@@ -468,7 +481,7 @@ public:
BlockNode *get_completion_block();
FunctionNode *get_completion_function();
int get_completion_argument_index();
-
+ int get_completion_identifier_is_function();
void clear();
GDParser();