Ejemplo n.º 1
0
        protected override void WriteName(CiSymbol symbol)
        {
            switch (symbol)
            {
            case CiContainerType _:
                Write(symbol.Name);
                break;

            case CiConst konst:
                if (konst.InMethod != null)
                {
                    WriteUppercaseWithUnderscores(konst.InMethod.Name);
                    Write('_');
                }
                WriteUppercaseWithUnderscores(symbol.Name);
                break;

            case CiVar _:
            case CiMember _:
                WriteCamelCaseNotKeyword(symbol.Name);
                break;

            default:
                throw new NotImplementedException(symbol.GetType().Name);
            }
        }
Ejemplo n.º 2
0
        protected override void WriteName(CiSymbol symbol)
        {
            switch (symbol)
            {
            case CiContainerType _:
                Write(symbol.Name);
                break;

            case CiVar _:
                WriteCamelCaseNotKeyword(symbol.Name);
                break;

            case CiMember _:
                if (symbol == CiSystem.CollectionCount)
                {
                    Write("size()");
                }
                else
                {
                    WriteCamelCaseNotKeyword(symbol.Name);
                }
                break;

            default:
                throw new NotImplementedException(symbol.GetType().Name);
            }
        }
Ejemplo n.º 3
0
        protected override void WriteName(CiSymbol symbol)
        {
            switch (symbol)
            {
            case CiContainerType container:
                if (!container.IsPublic)
                {
                    Write('_');
                }
                Write(symbol.Name);
                break;

            case CiConst konst:
                if (konst.Visibility != CiVisibility.Public)
                {
                    Write('_');
                }
                if (konst.InMethod != null)
                {
                    WriteUppercaseWithUnderscores(konst.InMethod.Name);
                    Write('_');
                }
                WriteUppercaseWithUnderscores(symbol.Name);
                break;

            case CiVar _:
                WriteNameNotKeyword(symbol.Name);
                break;

            case CiMember member:
                if (member.Visibility == CiVisibility.Public)
                {
                    WriteNameNotKeyword(symbol.Name);
                }
                else
                {
                    Write('_');
                    WriteLowercaseWithUnderscores(symbol.Name);
                }
                break;

            default:
                throw new NotImplementedException(symbol.GetType().Name);
            }
        }
Ejemplo n.º 4
0
        protected override void WriteName(CiSymbol symbol)
        {
            switch (symbol)
            {
            case CiContainerType _:
                Write(symbol.Name);
                break;

            case CiConst konst when konst.InMethod != null:
                WriteCamelCase(konst.InMethod.Name);
                WritePascalCase(symbol.Name);
                break;

            case CiVar _:
            case CiMember _:
                WriteCamelCaseNotKeyword(symbol.Name);
                break;

            default:
                throw new NotImplementedException(symbol.GetType().Name);
            }
        }