Example #1
0
        private IodineModule LoadIodineModule(string name)
        {
            string modulePath = FindModuleSource(name);

            if (modulePath != null)
            {
                SourceUnit source = SourceUnit.CreateFromFile(modulePath);
                return(source.Compile(this));
            }
            return(null);
        }
Example #2
0
        IodineModule LoadIodineModule(string name)
        {
            var modulePath = FindModuleSource(name);

            if (modulePath != null)
            {
                if (moduleCache.ContainsKey(modulePath))
                {
                    return(moduleCache [modulePath]);
                }


                var source = SourceUnit.CreateFromFile(modulePath);

                var module = source.Compile(this);

                moduleCache [modulePath] = module;

                return(module);
            }

            return(null);
        }