diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2020-08-28 10:36:09 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-28 10:36:09 +0200 |
commit | 46809332ddb108ad93aaa5df18f6ffc7bf65d432 (patch) | |
tree | e2108d40ee401ad78c343689ab9b4f54b1cc9b95 /modules/gdscript/gdscript_parser.cpp | |
parent | 1ff139cb28137d5b1b492f74e5fc58cbeee01e4a (diff) | |
parent | 5033d5c71c1140262953c993568d48ed762648c5 (diff) | |
download | redot-engine-46809332ddb108ad93aaa5df18f6ffc7bf65d432.tar.gz |
Merge pull request #41547 from vnen/gdscript-2-fixes
Some more GDScript fixes
Diffstat (limited to 'modules/gdscript/gdscript_parser.cpp')
-rw-r--r-- | modules/gdscript/gdscript_parser.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/modules/gdscript/gdscript_parser.cpp b/modules/gdscript/gdscript_parser.cpp index aeec1c0379..03da5e926b 100644 --- a/modules/gdscript/gdscript_parser.cpp +++ b/modules/gdscript/gdscript_parser.cpp @@ -631,7 +631,6 @@ void GDScriptParser::parse_extends() { current_class->extends_path = previous.literal; if (!match(GDScriptTokenizer::Token::PERIOD)) { - end_statement("superclass path"); return; } } @@ -1356,7 +1355,7 @@ GDScriptParser::Node *GDScriptParser::parse_statement() { advance(); ReturnNode *n_return = alloc_node<ReturnNode>(); if (!is_statement_end()) { - if (current_function->identifier->name == GDScriptLanguage::get_singleton()->strings._init) { + if (current_function && current_function->identifier->name == GDScriptLanguage::get_singleton()->strings._init) { push_error(R"(Constructor cannot return a value.)"); } n_return->return_value = parse_expression(false); |