summaryrefslogtreecommitdiff
path: root/modules/gdscript/gd_tokenizer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'modules/gdscript/gd_tokenizer.cpp')
-rw-r--r--modules/gdscript/gd_tokenizer.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/modules/gdscript/gd_tokenizer.cpp b/modules/gdscript/gd_tokenizer.cpp
index aeee1f6667..f73c895d74 100644
--- a/modules/gdscript/gd_tokenizer.cpp
+++ b/modules/gdscript/gd_tokenizer.cpp
@@ -95,6 +95,7 @@ const char* GDTokenizer::token_names[TK_MAX]={
"var",
"preload",
"assert",
+"yield",
"'['",
"']'",
"'{'",
@@ -757,6 +758,7 @@ void GDTokenizerText::_advance() {
{Variant::_RID,"RID"},
{Variant::OBJECT,"Object"},
{Variant::INPUT_EVENT,"InputEvent"},
+ {Variant::NODE_PATH,"NodePath"},
{Variant::DICTIONARY,"dict"},
{Variant::DICTIONARY,"Dictionary"},
{Variant::ARRAY,"Array"},
@@ -825,6 +827,7 @@ void GDTokenizerText::_advance() {
{TK_PR_VAR,"var"},
{TK_PR_PRELOAD,"preload"},
{TK_PR_ASSERT,"assert"},
+ {TK_PR_YIELD,"yield"},
{TK_PR_CONST,"const"},
//controlflow
{TK_CF_IF,"if"},
@@ -1005,7 +1008,7 @@ void GDTokenizerText::advance(int p_amount) {
//////////////////////////////////////////////////////////////////////////////////////////////////////
-#define BYTECODE_VERSION 1
+#define BYTECODE_VERSION 2
Error GDTokenizerBuffer::set_code_buffer(const Vector<uint8_t> & p_buffer) {
@@ -1015,8 +1018,8 @@ Error GDTokenizerBuffer::set_code_buffer(const Vector<uint8_t> & p_buffer) {
ERR_FAIL_COND_V( p_buffer.size()<24 || p_buffer[0]!='G' || p_buffer[1]!='D' || p_buffer[2]!='S' || p_buffer[3]!='C',ERR_INVALID_DATA);
int version = decode_uint32(&buf[4]);
- if (version>1) {
- ERR_EXPLAIN("Bytecode is too New!");
+ if (version>BYTECODE_VERSION) {
+ ERR_EXPLAIN("Bytecode is too New! Please use a newer engine version.");
ERR_FAIL_COND_V(version>BYTECODE_VERSION,ERR_INVALID_DATA);
}
int identifier_count = decode_uint32(&buf[8]);