public DefinedEnum(ParseInfo parseInfo, DeltinScriptParser.Enum_defineContext enumContext) : base(enumContext.name.Text)
        {
            CanBeExtended = false;
            CanBeDeleted  = false;
            Kind          = "enum";

            if (parseInfo.TranslateInfo.IsCodeType(Name))
            {
                parseInfo.Script.Diagnostics.Error($"A type with the name '{Name}' already exists.", DocRange.GetRange(enumContext.name));
            }

            _translateInfo = parseInfo.TranslateInfo;
            Scope          = new Scope("enum " + Name);

            DefinedAt = new LanguageServer.Location(parseInfo.Script.Uri, DocRange.GetRange(enumContext.name));
            _translateInfo.AddSymbolLink(this, DefinedAt, true);

            // Get the enum members.
            List <DefinedEnumMember> members = new List <DefinedEnumMember>();

            if (enumContext.firstMember != null)
            {
                members.Add(new DefinedEnumMember(parseInfo, this, enumContext.firstMember.Text, 0, new Location(parseInfo.Script.Uri, DocRange.GetRange(enumContext.firstMember))));

                if (enumContext.enum_element() != null)
                {
                    for (int i = 0; i < enumContext.enum_element().Length; i++)
                    {
                        members.Add(
                            new DefinedEnumMember(
                                parseInfo, this, enumContext.enum_element(i).PART().GetText(), i + 1, new Location(parseInfo.Script.Uri, DocRange.GetRange(enumContext.enum_element(i).PART()))
                                )
                            );
                    }
                }
            }

            foreach (var member in members)
            {
                Scope.AddVariable(member, null, null);
            }
        }