GDScript: Allow "extends" to be used inside inner class

This commit is contained in:
George Marques 2020-08-31 10:27:11 -03:00
parent 34dc689ad4
commit edb4caf24e
No known key found for this signature in database
GPG key ID: 046BD46A3201E43D

View file

@ -586,6 +586,14 @@ GDScriptParser::ClassNode *GDScriptParser::parse_class() {
return n_class;
}
if (match(GDScriptTokenizer::Token::EXTENDS)) {
if (n_class->extends_used) {
push_error(R"(Cannot use "extends" more than once in the same class.)");
}
parse_extends();
end_statement("superclass");
}
parse_class_body();
consume(GDScriptTokenizer::Token::DEDENT, R"(Missing unindent at the end of the class body.)");