Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix line num of enums reported as the line before #41126

Merged
merged 1 commit into from
Aug 10, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions modules/gdscript/gdscript_parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5204,6 +5204,7 @@ void GDScriptParser::_parse_class(ClassNode *p_class) {
int last_assign = -1; // Incremented by 1 right before the assignment.
String enum_name;
Dictionary enum_dict;
int enum_start_line = tokenizer->get_token_line();

tokenizer->advance();
if (tokenizer->is_token_literal(0, true)) {
Expand Down Expand Up @@ -5340,6 +5341,7 @@ void GDScriptParser::_parse_class(ClassNode *p_class) {
ConstantNode *cn = alloc_node<ConstantNode>();
cn->value = enum_dict;
cn->datatype = _type_from_variant(cn->value);
cn->line = enum_start_line;

enum_constant.expression = cn;
enum_constant.type = cn->datatype;
Expand Down