diff options
Diffstat (limited to 'modules/gdscript/gd_parser.cpp')
-rw-r--r-- | modules/gdscript/gd_parser.cpp | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/modules/gdscript/gd_parser.cpp b/modules/gdscript/gd_parser.cpp index 80d77b6f1b..1f2b7291e5 100644 --- a/modules/gdscript/gd_parser.cpp +++ b/modules/gdscript/gd_parser.cpp @@ -309,10 +309,6 @@ GDParser::Node* GDParser::_parse_expression(Node *p_parent,bool p_static,bool p_ _set_error("expected string constant as 'preload' argument."); return NULL; } - if (path.begins_with("/")) { - _set_error("Paths cannot start with '/', absolute paths must start with \'res://\', \'user://\', or \'local://\'"); - return NULL; - } if (!path.is_abs_path() && base_path!="") path=base_path+"/"+path; path = path.replace("///","//").simplify_path(); @@ -2125,10 +2121,6 @@ void GDParser::_parse_extends(ClassNode *p_class) { _set_error("'extends' constant must be a string."); return; } - if (((String)(constant)).begins_with("/")) { - _set_error("Paths cannot start with '/', absolute paths must start with \'res://\', \'user://\', or \'local://\'"); - return; - } p_class->extends_file=constant; tokenizer->advance(); @@ -3386,7 +3378,16 @@ void GDParser::_parse_class(ClassNode *p_class) { } break; - + + case GDTokenizer::TK_CONSTANT: { + if(tokenizer->get_token_constant().get_type() == Variant::STRING) { + tokenizer->advance(); + // Ignore + } else { + _set_error(String()+"Unexpected constant of type: "+Variant::get_type_name(tokenizer->get_token_constant().get_type())); + return; + } + } break; default: { |