Пример #1
0
            private Symbol?ProcessTopLevelDeclaration(ModuleSymbol moduleSymbol, TopLevelDecl topLevelDeclaration)
            {
                _cancellationToken.ThrowIfCancellationRequested();
                switch (topLevelDeclaration)
                {
                case ClassDecl classDeclaration:
                    return(ProcessClass(moduleSymbol, classDeclaration));

                case LiteralModuleDecl literalModuleDeclaration:
                    return(ProcessModule(moduleSymbol, literalModuleDeclaration.ModuleDef));

                case ValuetypeDecl valueTypeDeclaration:
                    return(ProcessValueType(moduleSymbol, valueTypeDeclaration));

                default:
                    _logger.LogWarning("encountered unknown top level declaration {} of type {}", topLevelDeclaration.Name, topLevelDeclaration.GetType());
                    return(null);
                }
            }
Пример #2
0
            private Symbol?ProcessTopLevelDeclaration(ModuleSymbol moduleSymbol, TopLevelDecl topLevelDeclaration)
            {
                switch (topLevelDeclaration)
                {
                case ClassDecl classDeclaration:
                    return(ProcessClass(moduleSymbol, classDeclaration));

                case LiteralModuleDecl literalModuleDeclaration:
                    return(ProcessModule(moduleSymbol, literalModuleDeclaration.ModuleDef));

                case ValuetypeDecl valueTypeDeclaration:
                    return(ProcessValueType(moduleSymbol, valueTypeDeclaration));

                case DatatypeDecl dataTypeDeclaration:
                    return(ProcessDataType(moduleSymbol, dataTypeDeclaration));

                default:
                    logger.LogDebug("encountered unknown top level declaration {Name} of type {Type}", topLevelDeclaration.Name, topLevelDeclaration.GetType());
                    return(null);
                }
            }