示例#1
0
        private Scope LoadSTDModule(string rawPath)
        {
            var name = $"std/{rawPath.Substring(4)}";

            if (loadedModules.ContainsKey(name))
            {
                return(loadedModules[name].Scope);
            }

            var nativeModule = NativeModuleLoader.LoadNativeModule(rawPath);

            if (nativeModule == null)
            {
                return(LoadSTDSource(rawPath));
            }
            else
            {
                return(LoadNativeModule(nativeModule));
            }
        }
示例#2
0
        private Scope LoadSTDModule(string rawPath)
        {
            var name = $"{rawPath.Substring(rawPath.LastIndexOf('/') + 1)}.neo";

            if (loadedModules.ContainsKey(name))
            {
                return(loadedModules[name].Scope);
            }

            var nativeModule = NativeModuleLoader.LoadNativeModule(rawPath);

            if (nativeModule == null)
            {
                return(LoadSTDSource(rawPath));
            }
            else
            {
                return(LoadNativeModule(nativeModule));
            }
        }