public void setCWD(string cd) { if (cd != null) { cwd = FileSystem.GetFullPath(cd); } }
/// <summary> /// Main entry to the analyzer /// </summary> public void Analyze(string path) { string upath = FileSystem.GetFullPath(path); projectDir = FileSystem.DirectoryExists(upath) ? upath : FileSystem.GetDirectoryName(upath); LoadFileRecursive(upath); }
public DataType LoadFile(string path) { path = FileSystem.GetFullPath(path); if (!FileSystem.FileExists(path)) { return(null); } ModuleType module = GetCachedModule(path); if (module != null) { return(module); } // detect circular import if (inImportStack(path)) { return(null); } // set new CWD and save the old one on stack string oldcwd = cwd; setCWD(FileSystem.GetDirectoryName(path)); pushImportStack(path); DataType type = parseAndResolve(path); popImportStack(path); // restore old CWD setCWD(oldcwd); return(type); }
public void addPath(string p) { path.Add(FileSystem.GetFullPath(p)); }