public void LoadFile(string filename)
{
filename = this.GetFilename(filename);
string originalpath = currentPath;
string filepath = (new FileInfo(filename)).DirectoryName;
try
{
currentPath = filepath;
Loader loader = new Loader(filename, new SimpleCompiler());
loader.LoadAndExecute(this);
}
finally
{
currentPath = originalpath;
}
}
public void LoadLibrary2UsingLoadFile() { Machine machine = new Machine(); machine.LoadFile("Library2.st"); Assert.IsNotNull(machine.GetGlobalObject("Object")); Assert.IsNotNull(machine.GetGlobalObject("Behavior")); Assert.IsNotNull(machine.GetGlobalObject("ClassDescription")); Assert.IsNotNull(machine.GetGlobalObject("Class")); Assert.IsNotNull(machine.GetGlobalObject("Metaclass")); Assert.IsNotNull(machine.GetGlobalObject("UndefinedObject")); }