diff options
author | George Marques <george@gmarqu.es> | 2020-08-31 10:27:11 -0300 |
---|---|---|
committer | George Marques <george@gmarqu.es> | 2020-09-01 09:26:27 -0300 |
commit | edb4caf24e29d2e0836b5d86c33ba4c32cc6afd1 (patch) | |
tree | 4993d232e05ee5947124cb0df56057de4ec99261 /modules/gdscript/gdscript_parser.cpp | |
parent | 34dc689ad40980869d2a2d08b68ae6b9ec36d498 (diff) |
GDScript: Allow "extends" to be used inside inner class
Diffstat (limited to 'modules/gdscript/gdscript_parser.cpp')
-rw-r--r-- | modules/gdscript/gdscript_parser.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/modules/gdscript/gdscript_parser.cpp b/modules/gdscript/gdscript_parser.cpp index 0a4ca01a32..4761506381 100644 --- a/modules/gdscript/gdscript_parser.cpp +++ b/modules/gdscript/gdscript_parser.cpp @@ -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.)"); |