### Godot version

4.0 beta 10

### System information

Windows 10

### Issue description

Godot crashes when i accidently name 2 items in an enum the same

EDIT:
The editor freeze for some seconds, then both editor- and console-window dissapear

### Steps to reproduce

Write

```gdscript
enum {
    A,
}
```

and then add a second line with another A:

```gdscript
enum {
    A,
    A # <- crash
}
```

Does not always immediatly happen if i copy&paste items.
Does not happen when i change the script in another editor and open the script in Godot.

### Minimal reproduction project

[enum.zip](https://github.com/godotengine/godot/files/10313759/enum.zip)

if (valid) {
			p_identifier->is_constant = true;
			p_identifier->reduced_value = int_constant;
			p_identifier->source = GDScriptParser::IdentifierNode::MEMBER_CONSTANT;
			
			StringName enum_name = ClassDB::get_integer_constant_enum(native, name);
			if (enum_name != StringName()) {
				p_identifier->set_datatype(make_native_enum_type(enum_name, native, false));
			} else {
				p_identifier->set_datatype(type_from_variant(int_constant, p_identifier));
			}
		}
	}
}
void GDScriptAnalyzer::reduce_identifier(GDScriptParser::IdentifierNode *p_identifier, bool can_be_builtin) {
	
	
	if (current_enum) {
		for (int i = 0; i < current_enum->values.size(); i++) {
			const GDScriptParser::EnumNode::Value &element = current_enum->values[i];
			if (element.identifier->name == p_identifier->name) {
				StringName enum_name = current_enum->identifier->name ? current_enum->identifier->name : UNNAMED_ENUM;
				GDScriptParser::DataType type = make_enum_type(enum_name, parser->current_class->fqcn, false);
				if (element.parent_enum->identifier) {
					type.enum_type = element.parent_enum->identifier->name;
				}
				p_identifier->set_datatype(type);
				if (element.resolved) {
					p_identifier->is_constant = true;
					p_identifier->reduced_value = element.value;