summaryrefslogtreecommitdiffstats
path: root/modules/gdscript/gd_parser.cpp
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2014-06-27 23:21:45 -0300
committerJuan Linietsky <reduzio@gmail.com>2014-06-27 23:21:45 -0300
commit2af2a84a03fd707cfa4c682aff34d722343d8985 (patch)
tree50d064e8bba7d5efb5974e3fa3a67e076fb5ef8b /modules/gdscript/gd_parser.cpp
parent1cc96a4d7440d9e8a20f7dbf17cf5771170de83d (diff)
downloadredot-engine-2af2a84a03fd707cfa4c682aff34d722343d8985.tar.gz
Misc Fixes
========== -NOTIFICATION_WM_QUIT fixed on android (seems tha way this is reported changed in newer sdk) -WIP implementation of APK Expansion APIs for publishing games larger than 50mb in Play Store -Feaures in the new tutorials are all present in the sourcecode -This (hopefully) should get rid of the animation list order getting corrupted -Improved 3D Scene Importer (Skeletons, Animations and other stuff were not being merged). Anything missing? -In code editor, the automatic syntax checker will only use file_exists() to check preload() else it might freeze the editor too much while typing if the preload is a big resource -Fixed bugs in PolygonPathFinder, stil pending to do a node and a demo
Diffstat (limited to 'modules/gdscript/gd_parser.cpp')
-rw-r--r--modules/gdscript/gd_parser.cpp26
1 files changed, 20 insertions, 6 deletions
diff --git a/modules/gdscript/gd_parser.cpp b/modules/gdscript/gd_parser.cpp
index 2829132d99..40c262c503 100644
--- a/modules/gdscript/gd_parser.cpp
+++ b/modules/gdscript/gd_parser.cpp
@@ -29,6 +29,7 @@
#include "gd_parser.h"
#include "print_string.h"
#include "io/resource_loader.h"
+#include "os/file_access.h"
/* TODO:
*Property reduce constant expressions
@@ -224,12 +225,23 @@ GDParser::Node* GDParser::_parse_expression(Node *p_parent,bool p_static,bool p_
String path = tokenizer->get_token_constant();
if (!path.is_abs_path() && base_path!="")
path=base_path+"/"+path;
- path = path.replace("///","//");
+ path = path.replace("///","//");
- Ref<Resource> res = ResourceLoader::load(path);
- if (!res.is_valid()) {
- _set_error("Can't preload resource at path: "+path);
- return NULL;
+ Ref<Resource> res;
+ if (!validating) {
+
+ //this can be too slow for just validating code
+ res = ResourceLoader::load(path);
+ if (!res.is_valid()) {
+ _set_error("Can't preload resource at path: "+path);
+ return NULL;
+ }
+ } else {
+
+ if (!FileAccess::exists(path)) {
+ _set_error("Can't preload resource at path: "+path);
+ return NULL;
+ }
}
tokenizer->advance();
@@ -2468,12 +2480,13 @@ Error GDParser::parse_bytecode(const Vector<uint8_t> &p_bytecode,const String& p
}
-Error GDParser::parse(const String& p_code,const String& p_base_path) {
+Error GDParser::parse(const String& p_code,const String& p_base_path,bool p_just_validate) {
GDTokenizerText *tt = memnew( GDTokenizerText );
tt->set_code(p_code);
+ validating=p_just_validate;
tokenizer=tt;
Error ret = _parse(p_base_path);
memdelete(tt);
@@ -2498,6 +2511,7 @@ void GDParser::clear() {
head=NULL;
list=NULL;
+ validating=false;
error_set=false;
tab_level.clear();
tab_level.push_back(0);