From e3f16a83dcc8748e90b2919bb32c4671e621db28 Mon Sep 17 00:00:00 2001 From: Francois Belair Date: Sat, 8 Aug 2020 11:52:25 -0400 Subject: [PATCH] Fix line num of enums reported as the line before --- modules/gdscript/gdscript_parser.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/gdscript/gdscript_parser.cpp b/modules/gdscript/gdscript_parser.cpp index c997ca253ff..f0f7e36dd80 100644 --- a/modules/gdscript/gdscript_parser.cpp +++ b/modules/gdscript/gdscript_parser.cpp @@ -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)) { @@ -5340,6 +5341,7 @@ void GDScriptParser::_parse_class(ClassNode *p_class) { ConstantNode *cn = alloc_node(); 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;