diff options
| author | Juan Linietsky | 2015-01-03 13:03:13 -0300 |
|---|---|---|
| committer | Juan Linietsky | 2015-01-03 13:03:13 -0300 |
| commit | 6b5b95bb4e269a1bd740707e27eae09983b84268 (patch) | |
| tree | aa0c80dd4d683eaa99e1ad804d8d742f369bdd73 /modules/gdscript/gd_parser.cpp | |
| parent | 85c084c7707c4b9cac978bc0caec0a76b5e37818 (diff) | |
| download | godot-6b5b95bb4e269a1bd740707e27eae09983b84268.tar.gz godot-6b5b95bb4e269a1bd740707e27eae09983b84268.tar.zst godot-6b5b95bb4e269a1bd740707e27eae09983b84268.zip | |
Diffstat (limited to 'modules/gdscript/gd_parser.cpp')
| -rw-r--r-- | modules/gdscript/gd_parser.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/modules/gdscript/gd_parser.cpp b/modules/gdscript/gd_parser.cpp index f79f3ee44..aa2878f9e 100644 --- a/modules/gdscript/gd_parser.cpp +++ b/modules/gdscript/gd_parser.cpp @@ -2027,14 +2027,20 @@ void GDParser::_parse_class(ClassNode *p_class) { } - if (tokenizer->get_token(1)!=GDTokenizer::TK_IDENTIFIER) { + tokenizer->advance(); + StringName name; + + if (_get_completable_identifier(COMPLETION_VIRTUAL_FUNC,name)) { + + } + + + if (name==StringName()) { _set_error("Expected identifier after 'func' (syntax: 'func <identifier>([arguments]):' )."); return; } - StringName name = tokenizer->get_token_identifier(1); - for(int i=0;i<p_class->functions.size();i++) { if (p_class->functions[i]->name==name) { _set_error("Function '"+String(name)+"' already exists in this class (at line: "+itos(p_class->functions[i]->line)+")."); @@ -2045,7 +2051,7 @@ void GDParser::_parse_class(ClassNode *p_class) { _set_error("Function '"+String(name)+"' already exists in this class (at line: "+itos(p_class->static_functions[i]->line)+")."); } } - tokenizer->advance(2); + if (tokenizer->get_token()!=GDTokenizer::TK_PARENTHESIS_OPEN) { |
