summaryrefslogtreecommitdiff
path: root/modules/gdscript
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2016-01-02 13:56:58 -0300
committerJuan Linietsky <reduzio@gmail.com>2016-01-02 13:56:58 -0300
commit0e0a7c9494622543e4ca2a865f3784babc4a2a78 (patch)
tree1b35dce7e6f3c2859d8f07e702a88cd52cc81f84 /modules/gdscript
parent27c47e09a183359706ef2497da9278b46f9190b6 (diff)
-properly handle newline in \ (line continuation) in gdscript, fixes #2112
-also fix a small crash in export detection with scripts that include themselves
Diffstat (limited to 'modules/gdscript')
-rw-r--r--modules/gdscript/gd_script.cpp28
-rw-r--r--modules/gdscript/gd_tokenizer.cpp1
2 files changed, 12 insertions, 17 deletions
diff --git a/modules/gdscript/gd_script.cpp b/modules/gdscript/gd_script.cpp
index 9b9b0e4b8c..9dddfdc1d9 100644
--- a/modules/gdscript/gd_script.cpp
+++ b/modules/gdscript/gd_script.cpp
@@ -33,17 +33,6 @@
#include "os/file_access.h"
#include "io/file_access_encrypted.h"
-/* TODO:
-
- *populate globals
- *do checks as close to debugger as possible (but don't do debugger)
- *const check plz
- *check arguments and default arguments in GDFunction
- -get property list in instance?
- *missing opcodes
- -const checks
- -make thread safe
- */
@@ -1740,16 +1729,21 @@ bool GDScript::_update_exports() {
}
}
- Ref<GDScript> bf = ResourceLoader::load(path);
+ if (path!=get_path()) {
+
+ Ref<GDScript> bf = ResourceLoader::load(path);
- if (bf.is_valid()) {
+ if (bf.is_valid()) {
- //print_line("parent is: "+bf->get_path());
- base_cache=bf;
- bf->inheriters_cache.insert(get_instance_ID());
+ //print_line("parent is: "+bf->get_path());
+ base_cache=bf;
+ bf->inheriters_cache.insert(get_instance_ID());
- //bf->_update_exports(p_instances,true,false);
+ //bf->_update_exports(p_instances,true,false);
+ }
+ } else {
+ ERR_PRINT(("Path extending itself in "+path).utf8().get_data());
}
}
diff --git a/modules/gdscript/gd_tokenizer.cpp b/modules/gdscript/gd_tokenizer.cpp
index bebdef83aa..61738146ae 100644
--- a/modules/gdscript/gd_tokenizer.cpp
+++ b/modules/gdscript/gd_tokenizer.cpp
@@ -260,6 +260,7 @@ void GDTokenizerText::_advance() {
}
INCPOS(1);
+ line++;
while(GETCHAR(0)==' ' || GETCHAR(0)=='\t') {
INCPOS(1);