diff options
| author | Anton Yabchinskiy | 2015-01-05 23:56:24 +0300 |
|---|---|---|
| committer | Anton Yabchinskiy | 2015-01-05 23:56:24 +0300 |
| commit | a7875c586af74302584544d777b189f4cb85c393 (patch) | |
| tree | f4929f77383d835b5be8b6e099b9db59000af610 /modules/gdscript/gd_parser.cpp | |
| parent | 4ab1bcde35a02cfe7b25d630720de1cc81ef5a1a (diff) | |
| parent | 8c4dd8de3919b789eac1a0f030563008bdcd44f5 (diff) | |
| download | godot-a7875c586af74302584544d777b189f4cb85c393.tar.gz godot-a7875c586af74302584544d777b189f4cb85c393.tar.zst godot-a7875c586af74302584544d777b189f4cb85c393.zip | |
Merge branch 'master' of github.com:okamstudio/godot
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) { |
