mirror of
				https://github.com/godotengine/godot.git
				synced 2025-11-04 07:31:16 +00:00 
			
		
		
		
	Fix line num of enums reported as the line before
This commit is contained in:
		
							parent
							
								
									23b553ba06
								
							
						
					
					
						commit
						e3f16a83dc
					
				
					 1 changed files with 2 additions and 0 deletions
				
			
		| 
						 | 
					@ -5204,6 +5204,7 @@ void GDScriptParser::_parse_class(ClassNode *p_class) {
 | 
				
			||||||
				int last_assign = -1; // Incremented by 1 right before the assignment.
 | 
									int last_assign = -1; // Incremented by 1 right before the assignment.
 | 
				
			||||||
				String enum_name;
 | 
									String enum_name;
 | 
				
			||||||
				Dictionary enum_dict;
 | 
									Dictionary enum_dict;
 | 
				
			||||||
 | 
									int enum_start_line = tokenizer->get_token_line();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
				tokenizer->advance();
 | 
									tokenizer->advance();
 | 
				
			||||||
				if (tokenizer->is_token_literal(0, true)) {
 | 
									if (tokenizer->is_token_literal(0, true)) {
 | 
				
			||||||
| 
						 | 
					@ -5340,6 +5341,7 @@ void GDScriptParser::_parse_class(ClassNode *p_class) {
 | 
				
			||||||
					ConstantNode *cn = alloc_node<ConstantNode>();
 | 
										ConstantNode *cn = alloc_node<ConstantNode>();
 | 
				
			||||||
					cn->value = enum_dict;
 | 
										cn->value = enum_dict;
 | 
				
			||||||
					cn->datatype = _type_from_variant(cn->value);
 | 
										cn->datatype = _type_from_variant(cn->value);
 | 
				
			||||||
 | 
										cn->line = enum_start_line;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
					enum_constant.expression = cn;
 | 
										enum_constant.expression = cn;
 | 
				
			||||||
					enum_constant.type = cn->datatype;
 | 
										enum_constant.type = cn->datatype;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue