/// <summary> /// Prepare AS2 intrinsic known vars/methods/classes /// </summary> protected override void InitTopLevelElements() { string filename = "toplevel.as"; topLevel = new FileModel(filename); // search top-level declaration foreach(PathModel aPath in classPath) if (File.Exists(Path.Combine(aPath.Path, filename))) { filename = Path.Combine(aPath.Path, filename); topLevel = GetCachedFileModel(filename); break; } if (File.Exists(filename)) { // MTASC toplevel-style declaration: ClassModel tlClass = topLevel.GetPublicClass(); if (!tlClass.IsVoid()) { topLevel.Members = tlClass.Members; tlClass.Members = null; topLevel.Classes = new List<ClassModel>(); } } // not found else { //ErrorHandler.ShowInfo("Top-level elements class not found. Please check your Program Settings."); } if (topLevel.Members.Search("_root", 0, 0) == null) topLevel.Members.Add(new MemberModel("_root", docType, FlagType.Variable, Visibility.Public)); if (topLevel.Members.Search("_global", 0, 0) == null) topLevel.Members.Add(new MemberModel("_global", features.objectKey, FlagType.Variable, Visibility.Public)); if (topLevel.Members.Search("this", 0, 0) == null) topLevel.Members.Add(new MemberModel("this", "", FlagType.Variable, Visibility.Public)); if (topLevel.Members.Search("super", 0, 0) == null) topLevel.Members.Add(new MemberModel("super", "", FlagType.Variable, Visibility.Public)); if (topLevel.Members.Search(features.voidKey, 0, 0) == null) topLevel.Members.Add(new MemberModel(features.voidKey, "", FlagType.Class | FlagType.Intrinsic, Visibility.Public)); topLevel.Members.Sort(); foreach (MemberModel member in topLevel.Members) member.Flags |= FlagType.Intrinsic; }
/// <summary> /// Prepare haxe intrinsic known vars/methods/classes /// </summary> protected override void InitTopLevelElements() { string filename = "toplevel.hx"; topLevel = new FileModel(filename); // search top-level declaration foreach (PathModel aPath in classPath) if (File.Exists(Path.Combine(aPath.Path, filename))) { filename = Path.Combine(aPath.Path, filename); topLevel = GetCachedFileModel(filename); break; } if (File.Exists(filename)) { // copy declarations as file-level ClassModel tlClass = topLevel.GetPublicClass(); if (!tlClass.IsVoid()) { topLevel.Members = tlClass.Members; tlClass.Members = null; topLevel.Classes = new List<ClassModel>(); } } // not found else { //ErrorHandler.ShowInfo("Top-level elements class not found. Please check your Program Settings."); } topLevel.Members.Add(new MemberModel("this", "", FlagType.Variable, Visibility.Public)); topLevel.Members.Add(new MemberModel("super", "", FlagType.Variable, Visibility.Public)); //topLevel.Members.Add(new MemberModel("Void", "", FlagType.Intrinsic, Visibility.Public)); topLevel.Members.Sort(); foreach (MemberModel member in topLevel.Members) member.Flags |= FlagType.Intrinsic; }